From: Christian Grothoff Date: Tue, 16 Mar 2010 12:10:48 +0000 (+0000) Subject: stats X-Git-Tag: initial-import-from-subversion-38251~22446 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=9ef7b2bb7eca1271e23db0951248b479a1a17f85;p=oweals%2Fgnunet.git stats --- diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c index da78b39d9..90274057f 100644 --- a/src/transport/gnunet-service-transport.c +++ b/src/transport/gnunet-service-transport.c @@ -919,6 +919,10 @@ transmit_to_client_callback (void *cls, size_t size, void *buf) /* fatal error with client, free message queue! */ while (NULL != (q = client->message_queue_head)) { + GNUNET_STATISTICS_update (stats, + gettext_noop ("# bytes discarded (could not transmit to client)"), + ntohs (((const struct GNUNET_MessageHeader*)&q[1])->size), + GNUNET_NO); GNUNET_CONTAINER_DLL_remove (client->message_queue_head, client->message_queue_tail, q); @@ -1055,6 +1059,20 @@ transmit_send_continuation (void *cls, struct MessageQueue *mq = cls; struct NeighbourList *n; + if (result == GNUNET_OK) + { + GNUNET_STATISTICS_update (stats, + gettext_noop ("# bytes successfully transmitted by plugins"), + mq->message_buf_size, + GNUNET_NO); + } + else + { + GNUNET_STATISTICS_update (stats, + gettext_noop ("# bytes with transmission failure by plugins"), + mq->message_buf_size, + GNUNET_NO); + } n = find_neighbour(&mq->neighbour_id); GNUNET_assert (n != NULL); if (mq->specific_address != NULL) @@ -1191,6 +1209,10 @@ try_transmission_to_peer (struct NeighbourList *neighbour) mq->message_buf_size, GNUNET_i2s (&mq->neighbour_id)); #endif + GNUNET_STATISTICS_update (stats, + gettext_noop ("# bytes discarded (no destination address available)"), + mq->message_buf_size, + GNUNET_NO); if (mq->client != NULL) transmit_send_ok (mq->client, neighbour, GNUNET_NO); GNUNET_CONTAINER_DLL_remove (neighbour->messages_head,