diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-10-18 11:29:48 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-10-18 11:29:48 +0000 |
commit | cb1f15d99cc240185a450b254c92adcb61a09790 (patch) | |
tree | 07f07cf287e98dc822551fc82a60bf86c10424f5 /src/fs | |
parent | 93326b9ca26d5dc7f4a50c76b7a84cd685af9b33 (diff) | |
download | gnunet-cb1f15d99cc240185a450b254c92adcb61a09790.tar.gz gnunet-cb1f15d99cc240185a450b254c92adcb61a09790.zip |
stuff
Diffstat (limited to 'src/fs')
-rw-r--r-- | src/fs/gnunet-service-fs.c | 14 | ||||
-rw-r--r-- | 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, | |||
3019 | struct PutMessage *pm; | 3019 | struct PutMessage *pm; |
3020 | struct ConnectedPeer *cp; | 3020 | struct ConnectedPeer *cp; |
3021 | struct GNUNET_TIME_Relative cur_delay; | 3021 | struct GNUNET_TIME_Relative cur_delay; |
3022 | #if SUPPORT_DELAYS | ||
3023 | struct GNUNET_TIME_Relative art_delay; | ||
3024 | #endif | ||
3022 | size_t msize; | 3025 | size_t msize; |
3023 | 3026 | ||
3024 | #if DEBUG_FS | 3027 | #if DEBUG_FS |
@@ -3210,10 +3213,15 @@ process_reply (void *cls, | |||
3210 | reply->cont = &transmit_reply_continuation; | 3213 | reply->cont = &transmit_reply_continuation; |
3211 | reply->cont_cls = pr; | 3214 | reply->cont_cls = pr; |
3212 | #if SUPPORT_DELAYS | 3215 | #if SUPPORT_DELAYS |
3216 | art_delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, | ||
3217 | GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, | ||
3218 | TTL_DECREMENT)); | ||
3213 | reply->delay_until | 3219 | reply->delay_until |
3214 | = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, | 3220 | = GNUNET_TIME_relative_to_absolute (art_delay); |
3215 | GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, | 3221 | GNUNET_STATISTICS_update (stats, |
3216 | TTL_DECREMENT))); | 3222 | gettext_noop ("cummulative artificial delay introduced (ms)"), |
3223 | art_delay.value, | ||
3224 | GNUNET_NO); | ||
3217 | #endif | 3225 | #endif |
3218 | reply->msize = msize; | 3226 | reply->msize = msize; |
3219 | reply->priority = UINT32_MAX; /* send replies first! */ | 3227 | 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 @@ | |||
32 | /** | 32 | /** |
33 | * File-size we use for testing. | 33 | * File-size we use for testing. |
34 | */ | 34 | */ |
35 | #define FILESIZE (1024 * 1024 * 1) | 35 | #define FILESIZE (1024 * 1024 * 10) |
36 | 36 | ||
37 | /** | 37 | /** |
38 | * How long until we give up on transmitting the message? | 38 | * How long until we give up on transmitting the message? |
@@ -82,15 +82,21 @@ struct StatValues | |||
82 | */ | 82 | */ |
83 | static struct StatValues stats[] = | 83 | static struct StatValues stats[] = |
84 | { | 84 | { |
85 | { "fs", "queries forwarded"}, | 85 | { "fs", "# queries forwarded"}, |
86 | { "fs", "replies received and matched"}, | 86 | { "fs", "# replies received and matched"}, |
87 | { "core", "bytes decrypted"}, | 87 | { "fs", "# results found locally"}, |
88 | { "core", "bytes encrypted"}, | 88 | { "fs", "# requests forwarded due to high load"}, |
89 | { "transport", "bytes received via TCP"}, | 89 | { "fs", "# requests done for free (low load)"}, |
90 | { "transport", "bytes transmitted via TCP"}, | 90 | { "fs", "# P2P searches received"}, |
91 | { "datacache", "bytes stored"}, | 91 | { "fs", "# replies received for local clients"}, |
92 | { "dht", "DHT ROUTE Requests Seen"}, | 92 | { "fs", "cummulative artificial delay introduced (ms)"}, |
93 | { "dht", "DHT ROUTE Requests Forwarded"}, | 93 | { "core", "# bytes decrypted"}, |
94 | { "core", "# bytes encrypted"}, | ||
95 | { "transport", "# bytes received via TCP"}, | ||
96 | { "transport", "# bytes transmitted via TCP"}, | ||
97 | { "datacache", "# bytes stored"}, | ||
98 | { "dht", "# DHT ROUTE Requests Seen"}, | ||
99 | { "dht", "# DHT ROUTE Requests Forwarded"}, | ||
94 | { NULL, NULL} | 100 | { NULL, NULL} |
95 | }; | 101 | }; |
96 | 102 | ||
@@ -114,7 +120,7 @@ print_stat (void *cls, | |||
114 | { | 120 | { |
115 | struct StatMaster *sm = cls; | 121 | struct StatMaster *sm = cls; |
116 | fprintf (stderr, | 122 | fprintf (stderr, |
117 | "Peer %3u: %8s/%40s = %llu\n", | 123 | "Peer %2u: %12s/%50s = %4llu\n", |
118 | sm->daemon, | 124 | sm->daemon, |
119 | subsystem, | 125 | subsystem, |
120 | name, | 126 | name, |
@@ -154,8 +160,12 @@ stat_run (void *cls, | |||
154 | if (stats[sm->value].name != NULL) | 160 | if (stats[sm->value].name != NULL) |
155 | { | 161 | { |
156 | GNUNET_STATISTICS_get (sm->stat, | 162 | GNUNET_STATISTICS_get (sm->stat, |
163 | #if 0 | ||
164 | NULL, NULL, | ||
165 | #else | ||
157 | stats[sm->value].subsystem, | 166 | stats[sm->value].subsystem, |
158 | stats[sm->value].name, | 167 | stats[sm->value].name, |
168 | #endif | ||
159 | GNUNET_TIME_UNIT_FOREVER_REL, | 169 | GNUNET_TIME_UNIT_FOREVER_REL, |
160 | &get_done, | 170 | &get_done, |
161 | &print_stat, sm); | 171 | &print_stat, sm); |
@@ -326,7 +336,7 @@ main (int argc, char *argv[]) | |||
326 | GNUNET_GETOPT_OPTION_END | 336 | GNUNET_GETOPT_OPTION_END |
327 | }; | 337 | }; |
328 | 338 | ||
329 | GNUNET_DISK_directory_remove ("/tmp/gnunet-perf-fs-lib/"); | 339 | GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-lib/"); |
330 | GNUNET_log_setup ("perf_gnunet_service_fs_p2p", | 340 | GNUNET_log_setup ("perf_gnunet_service_fs_p2p", |
331 | #if VERBOSE | 341 | #if VERBOSE |
332 | "DEBUG", | 342 | "DEBUG", |
@@ -337,7 +347,7 @@ main (int argc, char *argv[]) | |||
337 | GNUNET_PROGRAM_run ((sizeof (argvx) / sizeof (char *)) - 1, | 347 | GNUNET_PROGRAM_run ((sizeof (argvx) / sizeof (char *)) - 1, |
338 | argvx, "perf-gnunet-service-fs-p2p", | 348 | argvx, "perf-gnunet-service-fs-p2p", |
339 | "nohelp", options, &run, NULL); | 349 | "nohelp", options, &run, NULL); |
340 | GNUNET_DISK_directory_remove ("/tmp/gnunet-perf-fs-lib/"); | 350 | GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-lib/"); |
341 | return ok; | 351 | return ok; |
342 | } | 352 | } |
343 | 353 | ||