aboutsummaryrefslogtreecommitdiff
path: root/src/nse
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2011-12-12 17:29:09 +0000
committerBart Polot <bart@net.in.tum.de>2011-12-12 17:29:09 +0000
commit92bf2c7f90bb5e77bd30d3297b40e2299ad816f5 (patch)
treef2c9d9faf9533e46dd725647b7568ec0f2dd4caf /src/nse
parent46c5a3e13e6a53ba23fc9c5865fff5e9cf205595 (diff)
downloadgnunet-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.c72
-rw-r--r--src/nse/nse_profiler_test.conf43
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
50struct StatsContext 50struct 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]
2SERVICEHOME = /tmp/nse-profiler/ 2SERVICEHOME = /tmp/nse-profiler2/
3DEFAULTCONFIG = nse_profiler_test.conf 3DEFAULTCONFIG = 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
141DELETE_FILES = NO 141DELETE_FILES = YES
142 142
143[nse-profiler] 143[nse-profiler]
144OUTPUT_FILE = nse_output_4000_peers.dat 144OUTPUT_FILE = nse_output_4000_peers.dat
145TOPOLOGY_OUTPUT_FILE = nse_topo_4000_peers 145TOPOLOGY_OUTPUT_FILE = nse_topo_4000_peers
146DATA_OUTPUT_FILE = nse_topo_4000_peers_stats 146DATA_OUTPUT_FILE = nse_topo_4000_peers_stats
147#ROUND0 = 90 147ROUND0 = 4000
148#ROUND1 = 100 148ROUND1 = 4000
149#ROUND2 = 50 149ROUND2 = 4000
150#ROUND3 = 100 150ROUND3 = 4000
151#ROUND2 = 500 151ROUND4 = 4000
152#ROUND3 = 1000 152ROUND5 = 4000
153WAIT_TIME = 19200 s 153ROUND6 = 4000
154ROUND7 = 4000
155ROUND8 = 4000
156ROUND9 = 4000
157ROUND10 = 4000
158ROUND11 = 1000
159ROUND12 = 1000
160ROUND13 = 1000
161ROUND14 = 1000
162ROUND15 = 1000
163ROUND16 = 1000
164ROUND17 = 1000
165ROUND18 = 1000
166ROUND19 = 1000
167ROUND20 = 1000
168ROUND21 = 2000
169ROUND22 = 2000
170ROUND23 = 2000
171ROUND24 = 2000
172ROUND25 = 2000
173ROUND26 = 2000
174ROUND27 = 2000
175ROUND28 = 2000
176ROUND29 = 2000
177ROUND30 = 2000
178WAIT_TIME = 1920 s
154CONNECTION_LIMIT = 10 179CONNECTION_LIMIT = 10
155 180