From f2eef75811a8ad78f0dae68d569d0f5c82083064 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Thu, 23 Feb 2012 14:56:27 +0000 Subject: [PATCH] - Gather more stats --- src/nse/gnunet-nse-profiler.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/nse/gnunet-nse-profiler.c b/src/nse/gnunet-nse-profiler.c index ac1b6e8bc..8d091c1ad 100644 --- a/src/nse/gnunet-nse-profiler.c +++ b/src/nse/gnunet-nse-profiler.c @@ -73,6 +73,11 @@ struct StatsContext * How many extra messages per edge (corrections) have been received. */ unsigned long long total_nse_extra; + + /** + * How many messages have been discarded. + */ + unsigned long long total_discarded; }; @@ -455,6 +460,17 @@ stats_finished_callback (void *cls, int success) } GNUNET_free_non_null (buf); + buf = NULL; + buf_len = + GNUNET_asprintf (&buf, "TOTAL_NSE_DISCARDED_%d: %u \n", + stats_context->shutdown, + stats_context->total_discarded); + if (buf_len > 0) + { + GNUNET_DISK_file_write (data_file, buf, buf_len); + } + GNUNET_free_non_null (buf); + } if (GNUNET_YES == stats_context->shutdown) @@ -540,6 +556,10 @@ statistics_iterator (void *cls, const struct GNUNET_PeerIdentity *peer, { stats_context->total_nse_extra += value; } + if (0 == strcmp (name, "# flood messages discarded (clock skew too large)")) + { + stats_context->total_discarded += value; + } } return GNUNET_OK; } -- 2.25.1