aboutsummaryrefslogtreecommitdiff
path: root/src/nse
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2012-02-23 14:56:27 +0000
committerBart Polot <bart@net.in.tum.de>2012-02-23 14:56:27 +0000
commitf2eef75811a8ad78f0dae68d569d0f5c82083064 (patch)
treea202350a3840ec142e1bfb332fd28eccdc06e814 /src/nse
parenta5614a99a9c9d35ac57dc315ae94dce5d8cd6013 (diff)
downloadgnunet-f2eef75811a8ad78f0dae68d569d0f5c82083064.tar.gz
gnunet-f2eef75811a8ad78f0dae68d569d0f5c82083064.zip
- Gather more stats
Diffstat (limited to 'src/nse')
-rw-r--r--src/nse/gnunet-nse-profiler.c20
1 files changed, 20 insertions, 0 deletions
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
73 * How many extra messages per edge (corrections) have been received. 73 * How many extra messages per edge (corrections) have been received.
74 */ 74 */
75 unsigned long long total_nse_extra; 75 unsigned long long total_nse_extra;
76
77 /**
78 * How many messages have been discarded.
79 */
80 unsigned long long total_discarded;
76}; 81};
77 82
78 83
@@ -455,6 +460,17 @@ stats_finished_callback (void *cls, int success)
455 } 460 }
456 GNUNET_free_non_null (buf); 461 GNUNET_free_non_null (buf);
457 462
463 buf = NULL;
464 buf_len =
465 GNUNET_asprintf (&buf, "TOTAL_NSE_DISCARDED_%d: %u \n",
466 stats_context->shutdown,
467 stats_context->total_discarded);
468 if (buf_len > 0)
469 {
470 GNUNET_DISK_file_write (data_file, buf, buf_len);
471 }
472 GNUNET_free_non_null (buf);
473
458 } 474 }
459 475
460 if (GNUNET_YES == stats_context->shutdown) 476 if (GNUNET_YES == stats_context->shutdown)
@@ -540,6 +556,10 @@ statistics_iterator (void *cls, const struct GNUNET_PeerIdentity *peer,
540 { 556 {
541 stats_context->total_nse_extra += value; 557 stats_context->total_nse_extra += value;
542 } 558 }
559 if (0 == strcmp (name, "# flood messages discarded (clock skew too large)"))
560 {
561 stats_context->total_discarded += value;
562 }
543 } 563 }
544 return GNUNET_OK; 564 return GNUNET_OK;
545} 565}