/**
* File-size we use for testing.
*/
-#define FILESIZE (1024 * 1024 * 1)
+#define FILESIZE (1024 * 1024 * 10)
/**
* How long until we give up on transmitting the message?
* @return GNUNET_OK to continue, GNUNET_SYSERR to abort iteration
*/
static int
-print_stat (void *cls,
- const char *subsystem,
- const char *name, uint64_t value, int is_persistent)
+print_stat (void *cls, const char *subsystem, const char *name, uint64_t value,
+ int is_persistent)
{
struct StatMaster *sm = cls;
- fprintf (stderr,
- "Peer %2u: %12s/%50s = %12llu\n",
- sm->daemon, subsystem, name, (unsigned long long) value);
+ FPRINTF (stderr, "Peer %2u: %12s/%50s = %12llu\n", sm->daemon, subsystem,
+ name, (unsigned long long) value);
return GNUNET_OK;
}
/**
* Function that gathers stats from all daemons.
*/
-static void stat_run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+stat_run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
#else
stats[sm->value].subsystem, stats[sm->value].name,
#endif
- GNUNET_TIME_UNIT_FOREVER_REL,
- &get_done, &print_stat, sm);
+ GNUNET_TIME_UNIT_FOREVER_REL, &get_done, &print_stat,
+ sm);
return;
}
GNUNET_STATISTICS_destroy (sm->stat, GNUNET_NO);
GNUNET_SCHEDULER_add_now (&do_stop, NULL);
return;
}
- sm->stat = GNUNET_STATISTICS_create ("<driver>",
- GNUNET_FS_TEST_get_configuration
- (daemons, sm->daemon));
+ sm->stat =
+ GNUNET_STATISTICS_create ("<driver>",
+ GNUNET_FS_TEST_get_configuration (daemons,
+ sm->daemon));
GNUNET_SCHEDULER_add_now (&stat_run, sm);
}
fancy =
GNUNET_STRINGS_byte_size_fancy (((unsigned long long) FILESIZE) *
1000LL / del.rel_value);
- fprintf (stdout, "Download speed was %s/s\n", fancy);
+ FPRINTF (stdout, "Download speed was %s/s\n", fancy);
GNUNET_free (fancy);
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Finished download, shutting down\n",
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Finished download, shutting down\n",
(unsigned long long) FILESIZE);
sm = GNUNET_malloc (sizeof (struct StatMaster));
- sm->stat = GNUNET_STATISTICS_create ("<driver>",
- GNUNET_FS_TEST_get_configuration
- (daemons, sm->daemon));
+ sm->stat =
+ GNUNET_STATISTICS_create ("<driver>",
+ GNUNET_FS_TEST_get_configuration (daemons,
+ sm->daemon));
GNUNET_SCHEDULER_add_now (&stat_run, sm);
}
else
ok = 1;
return;
}
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Downloading %llu bytes\n", (unsigned long long) FILESIZE);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Downloading %llu bytes\n",
+ (unsigned long long) FILESIZE);
start_time = GNUNET_TIME_absolute_get ();
if (NULL != strstr (progname, "dht"))
anonymity = 0;
else
anonymity = 1;
- GNUNET_FS_TEST_download (daemons[0],
- TIMEOUT,
- anonymity, SEED, uri, VERBOSE, &do_report, NULL);
+ GNUNET_FS_TEST_download (daemons[0], TIMEOUT, anonymity, SEED, uri, VERBOSE,
+ &do_report, NULL);
}
ok = 1;
return;
}
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Publishing %llu bytes\n", (unsigned long long) FILESIZE);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Publishing %llu bytes\n",
+ (unsigned long long) FILESIZE);
if (NULL != strstr (progname, "index"))
do_index = GNUNET_YES;
else
else
anonymity = 1;
- GNUNET_FS_TEST_publish (daemons[NUM_DAEMONS - 1],
- TIMEOUT,
- anonymity,
- do_index, FILESIZE, SEED,
- VERBOSE, &do_download, NULL);
+ GNUNET_FS_TEST_publish (daemons[NUM_DAEMONS - 1], TIMEOUT, anonymity,
+ do_index, FILESIZE, SEED, VERBOSE, &do_download,
+ NULL);
}
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Daemons started, will now try to connect them\n");
pg = GNUNET_FS_TEST_get_group (daemons);
- GNUNET_break ((NUM_DAEMONS - 1) * 2
- == (GNUNET_TESTING_create_topology (pg,
- GNUNET_TESTING_TOPOLOGY_LINE,
- GNUNET_TESTING_TOPOLOGY_NONE,
- NULL)));
- GNUNET_TESTING_connect_topology (pg,
- GNUNET_TESTING_TOPOLOGY_LINE,
- GNUNET_TESTING_TOPOLOGY_OPTION_NONE,
- 0.0,
+ GNUNET_break ((NUM_DAEMONS - 1) * 2 ==
+ (GNUNET_TESTING_create_topology
+ (pg, GNUNET_TESTING_TOPOLOGY_LINE,
+ GNUNET_TESTING_TOPOLOGY_NONE, NULL)));
+ GNUNET_TESTING_connect_topology (pg, GNUNET_TESTING_TOPOLOGY_LINE,
+ GNUNET_TESTING_TOPOLOGY_OPTION_NONE, 0.0,
TIMEOUT, NUM_DAEMONS, &do_publish, NULL);
}
static void
-run (void *cls,
- char *const *args,
- const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg)
+run (void *cls, char *const *args, const char *cfgfile,
+ const struct GNUNET_CONFIGURATION_Handle *cfg)
{
- GNUNET_FS_TEST_daemons_start ("fs_test_lib_data.conf",
- TIMEOUT,
- NUM_DAEMONS, daemons, &do_connect, NULL);
+ GNUNET_FS_TEST_daemons_start ("fs_test_lib_data.conf", TIMEOUT, NUM_DAEMONS,
+ daemons, &do_connect, NULL);
}
"WARNING",
#endif
NULL);
- GNUNET_PROGRAM_run ((sizeof (argvx) / sizeof (char *)) - 1,
- argvx, "perf-gnunet-service-fs-p2p-index",
- "nohelp", options, &run, NULL);
+ GNUNET_PROGRAM_run ((sizeof (argvx) / sizeof (char *)) - 1, argvx,
+ "perf-gnunet-service-fs-p2p-index", "nohelp", options,
+ &run, NULL);
GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-lib/");
return ok;
}