diff options
author | Bart Polot <bart@net.in.tum.de> | 2011-12-12 17:29:09 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2011-12-12 17:29:09 +0000 |
commit | 92bf2c7f90bb5e77bd30d3297b40e2299ad816f5 (patch) | |
tree | f2c9d9faf9533e46dd725647b7568ec0f2dd4caf /src/nse | |
parent | 46c5a3e13e6a53ba23fc9c5865fff5e9cf205595 (diff) | |
download | gnunet-92bf2c7f90bb5e77bd30d3297b40e2299ad816f5.tar.gz gnunet-92bf2c7f90bb5e77bd30d3297b40e2299ad816f5.zip |
- Gather more stats from nse runs
Diffstat (limited to 'src/nse')
-rw-r--r-- | src/nse/gnunet-nse-profiler.c | 72 | ||||
-rw-r--r-- | src/nse/nse_profiler_test.conf | 43 |
2 files changed, 89 insertions, 26 deletions
diff --git a/src/nse/gnunet-nse-profiler.c b/src/nse/gnunet-nse-profiler.c index d3ff044c2..988e6e15a 100644 --- a/src/nse/gnunet-nse-profiler.c +++ b/src/nse/gnunet-nse-profiler.c | |||
@@ -49,7 +49,14 @@ struct NSEPeer | |||
49 | 49 | ||
50 | struct StatsContext | 50 | struct StatsContext |
51 | { | 51 | { |
52 | unsigned long long total_nse_messages; | 52 | /** |
53 | * How many messages have peers received during the test. | ||
54 | */ | ||
55 | unsigned long long total_nse_received_messages; | ||
56 | /** | ||
57 | * How many messages have peers send during the test (should be == received). | ||
58 | */ | ||
59 | unsigned long long total_nse_sent_messages; | ||
53 | }; | 60 | }; |
54 | 61 | ||
55 | 62 | ||
@@ -390,8 +397,17 @@ stats_finished_callback (void *cls, int success) | |||
390 | /* Stats lookup successful, write out data */ | 397 | /* Stats lookup successful, write out data */ |
391 | buf = NULL; | 398 | buf = NULL; |
392 | buf_len = | 399 | buf_len = |
393 | GNUNET_asprintf (&buf, "TOTAL_NSE_MESSAGES: %u\n", | 400 | GNUNET_asprintf (&buf, "TOTAL_NSE_RECEIVED_MESSAGES: %u\n", |
394 | stats_context->total_nse_messages); | 401 | stats_context->total_nse_received_messages); |
402 | if (buf_len > 0) | ||
403 | { | ||
404 | GNUNET_DISK_file_write (data_file, buf, buf_len); | ||
405 | } | ||
406 | GNUNET_free_non_null (buf); | ||
407 | buf = NULL; | ||
408 | buf_len = | ||
409 | GNUNET_asprintf (&buf, "TOTAL_NSE_SENT_MESSAGES: %u\n", | ||
410 | stats_context->total_nse_sent_messages); | ||
395 | if (buf_len > 0) | 411 | if (buf_len > 0) |
396 | { | 412 | { |
397 | GNUNET_DISK_file_write (data_file, buf, buf_len); | 413 | GNUNET_DISK_file_write (data_file, buf, buf_len); |
@@ -423,26 +439,48 @@ statistics_iterator (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
423 | { | 439 | { |
424 | struct StatsContext *stats_context = cls; | 440 | struct StatsContext *stats_context = cls; |
425 | 441 | ||
426 | if ((0 == strcmp (subsystem, "nse")) && | 442 | if (0 == strcmp (subsystem, "nse")) |
427 | (0 == strcmp (name, "# flood messages received"))) | ||
428 | { | 443 | { |
429 | stats_context->total_nse_messages += value; | 444 | if (0 == strcmp (name, "# flood messages received")) |
430 | #if VERBOSE | ||
431 | if (data_file != NULL) | ||
432 | { | 445 | { |
433 | char *buf; | 446 | stats_context->total_nse_received_messages += value; |
434 | int buf_len; | 447 | #if VERBOSE |
435 | 448 | if (data_file != NULL) | |
436 | buf = NULL; | ||
437 | buf_len = | ||
438 | GNUNET_asprintf (&buf, "Peer %s: %u\n", GNUNET_i2s(peer), value); | ||
439 | if (buf_len > 0) | ||
440 | { | 449 | { |
441 | GNUNET_DISK_file_write (data_file, buf, buf_len); | 450 | char *buf; |
451 | int buf_len; | ||
452 | |||
453 | buf = NULL; | ||
454 | buf_len = | ||
455 | GNUNET_asprintf (&buf, "%s %u RECEIVED\n", GNUNET_i2s(peer), value); | ||
456 | if (buf_len > 0) | ||
457 | { | ||
458 | GNUNET_DISK_file_write (data_file, buf, buf_len); | ||
459 | } | ||
460 | GNUNET_free_non_null (buf); | ||
442 | } | 461 | } |
443 | GNUNET_free_non_null (buf); | 462 | #endif |
444 | } | 463 | } |
464 | if (0 == strcmp (name, "# flood messages sent")) | ||
465 | { | ||
466 | stats_context->total_nse_sent_messages += value; | ||
467 | #if VERBOSE | ||
468 | if (data_file != NULL) | ||
469 | { | ||
470 | char *buf; | ||
471 | int buf_len; | ||
472 | |||
473 | buf = NULL; | ||
474 | buf_len = | ||
475 | GNUNET_asprintf (&buf, "%s %u SENT\n", GNUNET_i2s(peer), value); | ||
476 | if (buf_len > 0) | ||
477 | { | ||
478 | GNUNET_DISK_file_write (data_file, buf, buf_len); | ||
479 | } | ||
480 | GNUNET_free_non_null (buf); | ||
481 | } | ||
445 | #endif | 482 | #endif |
483 | } | ||
446 | } | 484 | } |
447 | return GNUNET_OK; | 485 | return GNUNET_OK; |
448 | } | 486 | } |
diff --git a/src/nse/nse_profiler_test.conf b/src/nse/nse_profiler_test.conf index 6a6580221..54df2238b 100644 --- a/src/nse/nse_profiler_test.conf +++ b/src/nse/nse_profiler_test.conf | |||
@@ -1,5 +1,5 @@ | |||
1 | [PATHS] | 1 | [PATHS] |
2 | SERVICEHOME = /tmp/nse-profiler/ | 2 | SERVICEHOME = /tmp/nse-profiler2/ |
3 | DEFAULTCONFIG = nse_profiler_test.conf | 3 | DEFAULTCONFIG = nse_profiler_test.conf |
4 | 4 | ||
5 | [nse] | 5 | [nse] |
@@ -138,18 +138,43 @@ MAX_OUTSTANDING_CONNECTIONS = 200 | |||
138 | #NUM_PEERINFO_PER_HOST = 10 | 138 | #NUM_PEERINFO_PER_HOST = 10 |
139 | #SINGLE_STATISTICS_PER_HOST = YES | 139 | #SINGLE_STATISTICS_PER_HOST = YES |
140 | #NUM_STATISTICS_PER_HOST = 10 | 140 | #NUM_STATISTICS_PER_HOST = 10 |
141 | DELETE_FILES = NO | 141 | DELETE_FILES = YES |
142 | 142 | ||
143 | [nse-profiler] | 143 | [nse-profiler] |
144 | OUTPUT_FILE = nse_output_4000_peers.dat | 144 | OUTPUT_FILE = nse_output_4000_peers.dat |
145 | TOPOLOGY_OUTPUT_FILE = nse_topo_4000_peers | 145 | TOPOLOGY_OUTPUT_FILE = nse_topo_4000_peers |
146 | DATA_OUTPUT_FILE = nse_topo_4000_peers_stats | 146 | DATA_OUTPUT_FILE = nse_topo_4000_peers_stats |
147 | #ROUND0 = 90 | 147 | ROUND0 = 4000 |
148 | #ROUND1 = 100 | 148 | ROUND1 = 4000 |
149 | #ROUND2 = 50 | 149 | ROUND2 = 4000 |
150 | #ROUND3 = 100 | 150 | ROUND3 = 4000 |
151 | #ROUND2 = 500 | 151 | ROUND4 = 4000 |
152 | #ROUND3 = 1000 | 152 | ROUND5 = 4000 |
153 | WAIT_TIME = 19200 s | 153 | ROUND6 = 4000 |
154 | ROUND7 = 4000 | ||
155 | ROUND8 = 4000 | ||
156 | ROUND9 = 4000 | ||
157 | ROUND10 = 4000 | ||
158 | ROUND11 = 1000 | ||
159 | ROUND12 = 1000 | ||
160 | ROUND13 = 1000 | ||
161 | ROUND14 = 1000 | ||
162 | ROUND15 = 1000 | ||
163 | ROUND16 = 1000 | ||
164 | ROUND17 = 1000 | ||
165 | ROUND18 = 1000 | ||
166 | ROUND19 = 1000 | ||
167 | ROUND20 = 1000 | ||
168 | ROUND21 = 2000 | ||
169 | ROUND22 = 2000 | ||
170 | ROUND23 = 2000 | ||
171 | ROUND24 = 2000 | ||
172 | ROUND25 = 2000 | ||
173 | ROUND26 = 2000 | ||
174 | ROUND27 = 2000 | ||
175 | ROUND28 = 2000 | ||
176 | ROUND29 = 2000 | ||
177 | ROUND30 = 2000 | ||
178 | WAIT_TIME = 1920 s | ||
154 | CONNECTION_LIMIT = 10 | 179 | CONNECTION_LIMIT = 10 |
155 | 180 | ||