From cb1f15d99cc240185a450b254c92adcb61a09790 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 18 Oct 2010 11:29:48 +0000 Subject: [PATCH] stuff --- src/fs/gnunet-service-fs.c | 14 ++++++++--- src/fs/perf_gnunet_service_fs_p2p.c | 36 ++++++++++++++++++----------- 2 files changed, 34 insertions(+), 16 deletions(-) diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c index 9f8ec98e3..ad1fa4475 100644 --- a/src/fs/gnunet-service-fs.c +++ b/src/fs/gnunet-service-fs.c @@ -3019,6 +3019,9 @@ process_reply (void *cls, struct PutMessage *pm; struct ConnectedPeer *cp; struct GNUNET_TIME_Relative cur_delay; +#if SUPPORT_DELAYS +struct GNUNET_TIME_Relative art_delay; +#endif size_t msize; #if DEBUG_FS @@ -3210,10 +3213,15 @@ process_reply (void *cls, reply->cont = &transmit_reply_continuation; reply->cont_cls = pr; #if SUPPORT_DELAYS + art_delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, + GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, + TTL_DECREMENT)); reply->delay_until - = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, - GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, - TTL_DECREMENT))); + = GNUNET_TIME_relative_to_absolute (art_delay); + GNUNET_STATISTICS_update (stats, + gettext_noop ("cummulative artificial delay introduced (ms)"), + art_delay.value, + GNUNET_NO); #endif reply->msize = msize; reply->priority = UINT32_MAX; /* send replies first! */ diff --git a/src/fs/perf_gnunet_service_fs_p2p.c b/src/fs/perf_gnunet_service_fs_p2p.c index b836f6772..70e7cdb31 100644 --- a/src/fs/perf_gnunet_service_fs_p2p.c +++ b/src/fs/perf_gnunet_service_fs_p2p.c @@ -32,7 +32,7 @@ /** * 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? @@ -82,15 +82,21 @@ struct StatValues */ static struct StatValues stats[] = { - { "fs", "queries forwarded"}, - { "fs", "replies received and matched"}, - { "core", "bytes decrypted"}, - { "core", "bytes encrypted"}, - { "transport", "bytes received via TCP"}, - { "transport", "bytes transmitted via TCP"}, - { "datacache", "bytes stored"}, - { "dht", "DHT ROUTE Requests Seen"}, - { "dht", "DHT ROUTE Requests Forwarded"}, + { "fs", "# queries forwarded"}, + { "fs", "# replies received and matched"}, + { "fs", "# results found locally"}, + { "fs", "# requests forwarded due to high load"}, + { "fs", "# requests done for free (low load)"}, + { "fs", "# P2P searches received"}, + { "fs", "# replies received for local clients"}, + { "fs", "cummulative artificial delay introduced (ms)"}, + { "core", "# bytes decrypted"}, + { "core", "# bytes encrypted"}, + { "transport", "# bytes received via TCP"}, + { "transport", "# bytes transmitted via TCP"}, + { "datacache", "# bytes stored"}, + { "dht", "# DHT ROUTE Requests Seen"}, + { "dht", "# DHT ROUTE Requests Forwarded"}, { NULL, NULL} }; @@ -114,7 +120,7 @@ print_stat (void *cls, { struct StatMaster *sm = cls; fprintf (stderr, - "Peer %3u: %8s/%40s = %llu\n", + "Peer %2u: %12s/%50s = %4llu\n", sm->daemon, subsystem, name, @@ -154,8 +160,12 @@ stat_run (void *cls, if (stats[sm->value].name != NULL) { GNUNET_STATISTICS_get (sm->stat, +#if 0 + NULL, NULL, +#else stats[sm->value].subsystem, stats[sm->value].name, +#endif GNUNET_TIME_UNIT_FOREVER_REL, &get_done, &print_stat, sm); @@ -326,7 +336,7 @@ main (int argc, char *argv[]) GNUNET_GETOPT_OPTION_END }; - GNUNET_DISK_directory_remove ("/tmp/gnunet-perf-fs-lib/"); + GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-lib/"); GNUNET_log_setup ("perf_gnunet_service_fs_p2p", #if VERBOSE "DEBUG", @@ -337,7 +347,7 @@ main (int argc, char *argv[]) GNUNET_PROGRAM_run ((sizeof (argvx) / sizeof (char *)) - 1, argvx, "perf-gnunet-service-fs-p2p", "nohelp", options, &run, NULL); - GNUNET_DISK_directory_remove ("/tmp/gnunet-perf-fs-lib/"); + GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-lib/"); return ok; } -- 2.25.1