From: Christian Grothoff Date: Mon, 18 Mar 2013 10:44:15 +0000 (+0000) Subject: -count direct neighbors in stats X-Git-Tag: initial-import-from-subversion-38251~9612 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=ff0c0c5eb34e719b56d969ae15ee9e311c446553;p=oweals%2Fgnunet.git -count direct neighbors in stats --- 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,