From: Christian Grothoff Date: Sat, 22 Oct 2011 20:53:52 +0000 (+0000) Subject: more stats, better names X-Git-Tag: initial-import-from-subversion-38251~16339 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=3e352825a3526d2614a4865ee808cc0e1b66927c;p=oweals%2Fgnunet.git more stats, better names --- diff --git a/src/core/gnunet-service-core_kx.c b/src/core/gnunet-service-core_kx.c index dfc304226..767554398 100644 --- a/src/core/gnunet-service-core_kx.c +++ b/src/core/gnunet-service-core_kx.c @@ -665,6 +665,10 @@ GSC_KX_start (const struct GNUNET_PeerIdentity *pid) "Initiating key exchange with `%s'\n", GNUNET_i2s (pid)); #endif + GNUNET_STATISTICS_update (GSC_stats, + gettext_noop ("# key exchanges initiated"), + 1, + GNUNET_NO); kx = GNUNET_malloc (sizeof (struct GSC_KeyExchangeInfo)); kx->peer = *pid; kx->set_key_retry_frequency = INITIAL_SET_KEY_RETRY_FREQUENCY; @@ -685,6 +689,10 @@ GSC_KX_start (const struct GNUNET_PeerIdentity *pid) void GSC_KX_stop (struct GSC_KeyExchangeInfo *kx) { + GNUNET_STATISTICS_update (GSC_stats, + gettext_noop ("# key exchanges stopped"), + 1, + GNUNET_NO); if (kx->pitr != NULL) { GNUNET_PEERINFO_iterate_cancel (kx->pitr); @@ -1026,6 +1034,10 @@ send_keep_alive (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) "Sending KEEPALIVE to `%s'\n", GNUNET_i2s (&kx->peer)); #endif + GNUNET_STATISTICS_update (GSC_stats, + gettext_noop ("# keepalive messages sent"), + 1, + GNUNET_NO); setup_fresh_ping (kx); GSC_NEIGHBOURS_transmit (&kx->peer, &kx->ping.header, diff --git a/src/core/gnunet-service-core_sessions.c b/src/core/gnunet-service-core_sessions.c index c239f27c1..24aa2f9bc 100644 --- a/src/core/gnunet-service-core_sessions.c +++ b/src/core/gnunet-service-core_sessions.c @@ -185,7 +185,7 @@ GSC_SESSIONS_end (const struct GNUNET_PeerIdentity *pid) GNUNET_CONTAINER_multihashmap_remove (sessions, &session->peer.hashPubKey, session)); GNUNET_STATISTICS_set (GSC_stats, - gettext_noop ("# established sessions"), + gettext_noop ("# entries in session map"), GNUNET_CONTAINER_multihashmap_size (sessions), GNUNET_NO); if (NULL != session->tmap) @@ -223,7 +223,7 @@ GSC_SESSIONS_create (const struct GNUNET_PeerIdentity *peer, &peer->hashPubKey, session, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); GNUNET_STATISTICS_update (GSC_stats, - gettext_noop ("# established sessions"), + gettext_noop ("# entries in session map"), GNUNET_CONTAINER_multihashmap_size (sessions), GNUNET_NO); /* FIXME: we should probably do this periodically (in case @@ -811,9 +811,6 @@ GSC_SESSIONS_done () NULL); GNUNET_CONTAINER_multihashmap_destroy (sessions); sessions = NULL; - GNUNET_STATISTICS_set (GSC_stats, - gettext_noop ("# established sessions"), - 0, GNUNET_NO); } /* end of gnunet-service-core_sessions.c */