summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2015-01-09 18:04:36 +0000
committerBart Polot <bart@net.in.tum.de>2015-01-09 18:04:36 +0000
commit1aef5fe5b9b7a139ad5e56c228219623c055b4b5 (patch)
tree1f785af399b34e8e30a97752dfb569a2bd8bf1e5
parent212668b5d40c7f295eefb9da08192c2ae8d04c19 (diff)
- add statistics to DHT module
-rw-r--r--src/cadet/gnunet-service-cadet_dht.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/cadet/gnunet-service-cadet_dht.c b/src/cadet/gnunet-service-cadet_dht.c
index 7307ba001..d6228110f 100644
--- a/src/cadet/gnunet-service-cadet_dht.c
+++ b/src/cadet/gnunet-service-cadet_dht.c
@@ -218,7 +218,6 @@ announce_id (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
return;
}
LOG (GNUNET_ERROR_TYPE_DEBUG, "Announce ID\n");
-
/* TODO
* - Set data expiration in function of X
* - Adapt X to churn
@@ -230,12 +229,17 @@ announce_id (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
announce_id_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
&announce_id, cls);
LOG (GNUNET_ERROR_TYPE_DEBUG, " no hello, waiting!\n");
+ GNUNET_STATISTICS_update (stats, "# DHT announce skipped (no hello)",
+ 1, GNUNET_NO);
+
return;
}
expiration = GNUNET_HELLO_get_last_expiration (hello);
retry_time = GNUNET_TIME_absolute_get_remaining (expiration);
LOG (GNUNET_ERROR_TYPE_DEBUG, "Hello %p size: %u\n", hello, size);
+ GNUNET_STATISTICS_update (stats, "# DHT announce",
+ 1, GNUNET_NO);
memset (&phash, 0, sizeof (phash));
memcpy (&phash, &my_full_id, sizeof (my_full_id));
GNUNET_DHT_put (dht_handle, /* DHT handle */
@@ -346,8 +350,9 @@ GCD_search (const struct GNUNET_PeerIdentity *peer_id,
struct GNUNET_HashCode phash;
struct GCD_search_handle *h;
- LOG (GNUNET_ERROR_TYPE_DEBUG,
- " Starting DHT GET for peer %s\n", GNUNET_i2s (peer_id));
+ LOG (GNUNET_ERROR_TYPE_DEBUG, " Starting DHT GET for peer %s\n",
+ GNUNET_i2s (peer_id));
+ GNUNET_STATISTICS_update (stats, "# DHT search", 1, GNUNET_NO);
memset (&phash, 0, sizeof (phash));
memcpy (&phash, peer_id, sizeof (*peer_id));
h = GNUNET_new (struct GCD_search_handle);