From 92bf2c7f90bb5e77bd30d3297b40e2299ad816f5 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Mon, 12 Dec 2011 17:29:09 +0000 Subject: [PATCH] - Gather more stats from nse runs --- src/nse/gnunet-nse-profiler.c | 72 ++++++++++++++++++++++++++-------- 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 struct StatsContext { - unsigned long long total_nse_messages; + /** + * How many messages have peers received during the test. + */ + unsigned long long total_nse_received_messages; + /** + * How many messages have peers send during the test (should be == received). + */ + unsigned long long total_nse_sent_messages; }; @@ -390,8 +397,17 @@ stats_finished_callback (void *cls, int success) /* Stats lookup successful, write out data */ buf = NULL; buf_len = - GNUNET_asprintf (&buf, "TOTAL_NSE_MESSAGES: %u\n", - stats_context->total_nse_messages); + GNUNET_asprintf (&buf, "TOTAL_NSE_RECEIVED_MESSAGES: %u\n", + stats_context->total_nse_received_messages); + if (buf_len > 0) + { + GNUNET_DISK_file_write (data_file, buf, buf_len); + } + GNUNET_free_non_null (buf); + buf = NULL; + buf_len = + GNUNET_asprintf (&buf, "TOTAL_NSE_SENT_MESSAGES: %u\n", + stats_context->total_nse_sent_messages); if (buf_len > 0) { GNUNET_DISK_file_write (data_file, buf, buf_len); @@ -423,26 +439,48 @@ statistics_iterator (void *cls, const struct GNUNET_PeerIdentity *peer, { struct StatsContext *stats_context = cls; - if ((0 == strcmp (subsystem, "nse")) && - (0 == strcmp (name, "# flood messages received"))) + if (0 == strcmp (subsystem, "nse")) { - stats_context->total_nse_messages += value; -#if VERBOSE - if (data_file != NULL) + if (0 == strcmp (name, "# flood messages received")) { - char *buf; - int buf_len; - - buf = NULL; - buf_len = - GNUNET_asprintf (&buf, "Peer %s: %u\n", GNUNET_i2s(peer), value); - if (buf_len > 0) + stats_context->total_nse_received_messages += value; +#if VERBOSE + if (data_file != NULL) { - GNUNET_DISK_file_write (data_file, buf, buf_len); + char *buf; + int buf_len; + + buf = NULL; + buf_len = + GNUNET_asprintf (&buf, "%s %u RECEIVED\n", GNUNET_i2s(peer), value); + if (buf_len > 0) + { + GNUNET_DISK_file_write (data_file, buf, buf_len); + } + GNUNET_free_non_null (buf); } - GNUNET_free_non_null (buf); +#endif } + if (0 == strcmp (name, "# flood messages sent")) + { + stats_context->total_nse_sent_messages += value; +#if VERBOSE + if (data_file != NULL) + { + char *buf; + int buf_len; + + buf = NULL; + buf_len = + GNUNET_asprintf (&buf, "%s %u SENT\n", GNUNET_i2s(peer), value); + if (buf_len > 0) + { + GNUNET_DISK_file_write (data_file, buf, buf_len); + } + GNUNET_free_non_null (buf); + } #endif + } } return GNUNET_OK; } 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 @@ [PATHS] -SERVICEHOME = /tmp/nse-profiler/ +SERVICEHOME = /tmp/nse-profiler2/ DEFAULTCONFIG = nse_profiler_test.conf [nse] @@ -138,18 +138,43 @@ MAX_OUTSTANDING_CONNECTIONS = 200 #NUM_PEERINFO_PER_HOST = 10 #SINGLE_STATISTICS_PER_HOST = YES #NUM_STATISTICS_PER_HOST = 10 -DELETE_FILES = NO +DELETE_FILES = YES [nse-profiler] OUTPUT_FILE = nse_output_4000_peers.dat TOPOLOGY_OUTPUT_FILE = nse_topo_4000_peers DATA_OUTPUT_FILE = nse_topo_4000_peers_stats -#ROUND0 = 90 -#ROUND1 = 100 -#ROUND2 = 50 -#ROUND3 = 100 -#ROUND2 = 500 -#ROUND3 = 1000 -WAIT_TIME = 19200 s +ROUND0 = 4000 +ROUND1 = 4000 +ROUND2 = 4000 +ROUND3 = 4000 +ROUND4 = 4000 +ROUND5 = 4000 +ROUND6 = 4000 +ROUND7 = 4000 +ROUND8 = 4000 +ROUND9 = 4000 +ROUND10 = 4000 +ROUND11 = 1000 +ROUND12 = 1000 +ROUND13 = 1000 +ROUND14 = 1000 +ROUND15 = 1000 +ROUND16 = 1000 +ROUND17 = 1000 +ROUND18 = 1000 +ROUND19 = 1000 +ROUND20 = 1000 +ROUND21 = 2000 +ROUND22 = 2000 +ROUND23 = 2000 +ROUND24 = 2000 +ROUND25 = 2000 +ROUND26 = 2000 +ROUND27 = 2000 +ROUND28 = 2000 +ROUND29 = 2000 +ROUND30 = 2000 +WAIT_TIME = 1920 s CONNECTION_LIMIT = 10 -- 2.25.1