[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r16172 - gnunet/src/nse
From: |
gnunet |
Subject: |
[GNUnet-SVN] r16172 - gnunet/src/nse |
Date: |
Mon, 25 Jul 2011 15:13:38 +0200 |
Author: grothoff
Date: 2011-07-25 15:13:38 +0200 (Mon, 25 Jul 2011)
New Revision: 16172
Modified:
gnunet/src/nse/gnunet-service-nse.c
gnunet/src/nse/test_nse.conf
Log:
generate histograms
Modified: gnunet/src/nse/gnunet-service-nse.c
===================================================================
--- gnunet/src/nse/gnunet-service-nse.c 2011-07-25 12:45:34 UTC (rev 16171)
+++ gnunet/src/nse/gnunet-service-nse.c 2011-07-25 13:13:38 UTC (rev 16172)
@@ -45,6 +45,8 @@
#include "gnunet_nse_service.h"
#include "nse.h"
+#define ENABLE_HISTOGRAM GNUNET_YES
+
/**
* Over how many values do we calculate the weighted average?
*/
@@ -76,6 +78,11 @@
static struct GNUNET_TIME_Relative proof_find_delay;
+#if ENABLE_HISTOGRAM
+static struct GNUNET_BIO_WriteHandle *wh;
+#endif
+
+
/**
* Per-peer information.
*/
@@ -939,6 +946,10 @@
uint32_t matching_bits;
unsigned int idx;
+#if ENABLE_HISTOGRAM
+ if (NULL != wh)
+ GNUNET_BIO_write_int64 (wh, GNUNET_htonll (GNUNET_TIME_absolute_get
().abs_value));
+#endif
incoming_flood = (const struct GNUNET_NSE_FloodMessage *) message;
GNUNET_STATISTICS_update (stats,
"# flood messages received",
@@ -1181,6 +1192,13 @@
GNUNET_CRYPTO_rsa_key_free (my_private_key);
my_private_key = NULL;
}
+#if ENABLE_HISTOGRAM
+ if (wh != NULL)
+ {
+ GNUNET_BIO_write_close (wh);
+ wh = NULL;
+ }
+#endif
}
@@ -1346,6 +1364,16 @@
core_handlers); /* Register these handlers */
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
&shutdown_task, NULL);
+#if ENABLE_HISTOGRAM
+ if (GNUNET_OK ==
+ GNUNET_CONFIGURATION_get_value_filename (cfg,
+ "NSE", "HISTOGRAM",
+ &proof))
+ {
+ wh = GNUNET_BIO_write_open (proof);
+ GNUNET_free (proof);
+ }
+#endif
if (coreAPI == NULL)
{
GNUNET_SCHEDULER_shutdown ();
Modified: gnunet/src/nse/test_nse.conf
===================================================================
--- gnunet/src/nse/test_nse.conf 2011-07-25 12:45:34 UTC (rev 16171)
+++ gnunet/src/nse/test_nse.conf 2011-07-25 13:13:38 UTC (rev 16172)
@@ -57,7 +57,7 @@
AUTOSTART = NO
[testing]
-NUM_PEERS = 10
+NUM_PEERS = 1000
WEAKRANDOM = YES
TOPOLOGY = NONE
CONNECT_TOPOLOGY = SMALL_WORLD_RING
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r16172 - gnunet/src/nse,
gnunet <=