aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-03-16 12:19:22 +0000
committerChristian Grothoff <christian@grothoff.org>2010-03-16 12:19:22 +0000
commite854e44db02c14e84e5d03a65177138d2c206596 (patch)
treee9feb98b68aa8f345a092f4f601c5459497139ef
parent9ef7b2bb7eca1271e23db0951248b479a1a17f85 (diff)
downloadgnunet-e854e44db02c14e84e5d03a65177138d2c206596.tar.gz
gnunet-e854e44db02c14e84e5d03a65177138d2c206596.zip
stats
-rw-r--r--src/transport/gnunet-service-transport.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c
index 90274057f..6899ef5fb 100644
--- a/src/transport/gnunet-service-transport.c
+++ b/src/transport/gnunet-service-transport.c
@@ -1210,6 +1210,10 @@ try_transmission_to_peer (struct NeighbourList *neighbour)
1210 GNUNET_i2s (&mq->neighbour_id)); 1210 GNUNET_i2s (&mq->neighbour_id));
1211#endif 1211#endif
1212 GNUNET_STATISTICS_update (stats, 1212 GNUNET_STATISTICS_update (stats,
1213 gettext_noop ("# bytes in message queue for other peers"),
1214 -mq->message_buf_size,
1215 GNUNET_NO);
1216 GNUNET_STATISTICS_update (stats,
1213 gettext_noop ("# bytes discarded (no destination address available)"), 1217 gettext_noop ("# bytes discarded (no destination address available)"),
1214 mq->message_buf_size, 1218 mq->message_buf_size,
1215 GNUNET_NO); 1219 GNUNET_NO);
@@ -1258,6 +1262,10 @@ try_transmission_to_peer (struct NeighbourList *neighbour)
1258 rl->plugin->short_name); 1262 rl->plugin->short_name);
1259#endif 1263#endif
1260 GNUNET_STATISTICS_update (stats, 1264 GNUNET_STATISTICS_update (stats,
1265 gettext_noop ("# bytes in message queue for other peers"),
1266 -mq->message_buf_size,
1267 GNUNET_NO);
1268 GNUNET_STATISTICS_update (stats,
1261 gettext_noop ("# bytes transmitted to other peers"), 1269 gettext_noop ("# bytes transmitted to other peers"),
1262 mq->message_buf_size, 1270 mq->message_buf_size,
1263 GNUNET_NO); 1271 GNUNET_NO);
@@ -1308,7 +1316,7 @@ transmit_to_peer (struct TransportClient *client,
1308 if (mq->client == client) 1316 if (mq->client == client)
1309 { 1317 {
1310 /* client transmitted to same peer twice 1318 /* client transmitted to same peer twice
1311 before getting SendOk! */ 1319 before getting SEND_OK! */
1312 GNUNET_break (0); 1320 GNUNET_break (0);
1313 return; 1321 return;
1314 } 1322 }
@@ -1316,6 +1324,10 @@ transmit_to_peer (struct TransportClient *client,
1316 } 1324 }
1317 } 1325 }
1318#endif 1326#endif
1327 GNUNET_STATISTICS_update (stats,
1328 gettext_noop ("# bytes in message queue for other peers"),
1329 message_buf_size,
1330 GNUNET_NO);
1319 mq = GNUNET_malloc (sizeof (struct MessageQueue) + message_buf_size); 1331 mq = GNUNET_malloc (sizeof (struct MessageQueue) + message_buf_size);
1320 mq->specific_address = peer_address; 1332 mq->specific_address = peer_address;
1321 mq->client = client; 1333 mq->client = client;
@@ -2699,6 +2711,14 @@ disconnect_neighbour (struct NeighbourList *n, int check)
2699 /* free all messages on the queue */ 2711 /* free all messages on the queue */
2700 while (NULL != (mq = n->messages_head)) 2712 while (NULL != (mq = n->messages_head))
2701 { 2713 {
2714 GNUNET_STATISTICS_update (stats,
2715 gettext_noop ("# bytes in message queue for other peers"),
2716 -mq->message_buf_size,
2717 GNUNET_NO);
2718 GNUNET_STATISTICS_update (stats,
2719 gettext_noop ("# bytes discarded due to disconnect"),
2720 mq->message_buf_size,
2721 GNUNET_NO);
2702 GNUNET_CONTAINER_DLL_remove (n->messages_head, 2722 GNUNET_CONTAINER_DLL_remove (n->messages_head,
2703 n->messages_tail, 2723 n->messages_tail,
2704 mq); 2724 mq);