aboutsummaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_unix.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2012-05-10 14:07:52 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2012-05-10 14:07:52 +0000
commit3ca0f83c3ecd38f973deeb7aaf78e99899e3d6a6 (patch)
treeea486120ea67ea5d2806b33b9dfda66de13dcaa4 /src/transport/plugin_transport_unix.c
parent640ab793010bc7a22d1c9d0298e62dc1895972b4 (diff)
downloadgnunet-3ca0f83c3ecd38f973deeb7aaf78e99899e3d6a6.tar.gz
gnunet-3ca0f83c3ecd38f973deeb7aaf78e99899e3d6a6.zip
- more statistics
Diffstat (limited to 'src/transport/plugin_transport_unix.c')
-rw-r--r--src/transport/plugin_transport_unix.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/transport/plugin_transport_unix.c b/src/transport/plugin_transport_unix.c
index 47f3f8777..6862dd878 100644
--- a/src/transport/plugin_transport_unix.c
+++ b/src/transport/plugin_transport_unix.c
@@ -236,6 +236,9 @@ struct Plugin
236 struct GNUNET_ATS_Information ats_network; 236 struct GNUNET_ATS_Information ats_network;
237 237
238 unsigned int bytes_in_queue; 238 unsigned int bytes_in_queue;
239 unsigned int bytes_in_sent;
240 unsigned int bytes_in_recv;
241 unsigned int bytes_discarded;
239}; 242};
240 243
241 244
@@ -736,6 +739,11 @@ unix_demultiplexer (struct Plugin *plugin, struct GNUNET_PeerIdentity *sender,
736 739
737 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received message from %s\n", 740 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received message from %s\n",
738 un->sun_path); 741 un->sun_path);
742
743 plugin->bytes_in_recv += ntohs(currhdr->size);
744 GNUNET_STATISTICS_set (plugin->env->stats,"# UNIX bytes received",
745 plugin->bytes_in_recv, GNUNET_NO);
746
739 plugin->env->receive (plugin->env->cls, sender, currhdr, 747 plugin->env->receive (plugin->env->cls, sender, currhdr,
740 (const struct GNUNET_ATS_Information *) &ats, 2, 748 (const struct GNUNET_ATS_Information *) &ats, 2,
741 NULL, un->sun_path, strlen (un->sun_path) + 1); 749 NULL, un->sun_path, strlen (un->sun_path) + 1);
@@ -804,6 +812,7 @@ unix_plugin_select_read (struct Plugin * plugin)
804 GNUNET_break_op (0); 812 GNUNET_break_op (0);
805 break; 813 break;
806 } 814 }
815
807 unix_demultiplexer (plugin, &sender, currhdr, &un, sizeof (un)); 816 unix_demultiplexer (plugin, &sender, currhdr, &un, sizeof (un));
808 offset += csize; 817 offset += csize;
809 } 818 }
@@ -854,6 +863,9 @@ unix_plugin_select_write (struct Plugin * plugin)
854 plugin->bytes_in_queue -= msgw->msgsize; 863 plugin->bytes_in_queue -= msgw->msgsize;
855 GNUNET_STATISTICS_set (plugin->env->stats,"# UNIX bytes in send queue", 864 GNUNET_STATISTICS_set (plugin->env->stats,"# UNIX bytes in send queue",
856 plugin->bytes_in_queue, GNUNET_NO); 865 plugin->bytes_in_queue, GNUNET_NO);
866 plugin->bytes_discarded += msgw->msgsize;
867 GNUNET_STATISTICS_set (plugin->env->stats,"# UNIX bytes discarded",
868 plugin->bytes_discarded, GNUNET_NO);
857 869
858 GNUNET_free (msgw->msg); 870 GNUNET_free (msgw->msg);
859 GNUNET_free (msgw); 871 GNUNET_free (msgw);
@@ -869,6 +881,9 @@ unix_plugin_select_write (struct Plugin * plugin)
869 plugin->bytes_in_queue -= msgw->msgsize; 881 plugin->bytes_in_queue -= msgw->msgsize;
870 GNUNET_STATISTICS_set (plugin->env->stats,"# UNIX bytes in send queue", 882 GNUNET_STATISTICS_set (plugin->env->stats,"# UNIX bytes in send queue",
871 plugin->bytes_in_queue, GNUNET_NO); 883 plugin->bytes_in_queue, GNUNET_NO);
884 plugin->bytes_in_sent += msgw->msgsize;
885 GNUNET_STATISTICS_set (plugin->env->stats,"# UNIX bytes sent",
886 plugin->bytes_in_sent, GNUNET_NO);
872 887
873 GNUNET_free (msgw->msg); 888 GNUNET_free (msgw->msg);
874 GNUNET_free (msgw); 889 GNUNET_free (msgw);