From ff0c0c5eb34e719b56d969ae15ee9e311c446553 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 18 Mar 2013 10:44:15 +0000 Subject: [PATCH] -count direct neighbors in stats --- src/dv/gnunet-service-dv.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/dv/gnunet-service-dv.c b/src/dv/gnunet-service-dv.c index edb06c43d..352a5862d 100644 --- a/src/dv/gnunet-service-dv.c +++ b/src/dv/gnunet-service-dv.c @@ -738,6 +738,9 @@ handle_core_connect (void *cls, const struct GNUNET_PeerIdentity *peer, } if (DIRECT_NEIGHBOR_COST != distance) return; /* is a DV-neighbor */ + GNUNET_STATISTICS_update (stats, + "# peers connected (1-hop)", + -1 1, GNUNET_NO); neighbor = GNUNET_malloc (sizeof (struct DirectNeighbor)); neighbor->peer = *peer; GNUNET_assert (GNUNET_YES == @@ -1381,6 +1384,9 @@ handle_core_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer) /* must have been a DV-neighbor, ignore */ return; } + GNUNET_STATISTICS_update (stats, + "# peers connected (1-hop)", + -1 1, GNUNET_NO); cleanup_neighbor (neighbor); GNUNET_CONTAINER_multihashmap_iterate (direct_neighbors, &refresh_routes, -- 2.25.1