gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r10631 - gnunet/src/core


From: gnunet
Subject: [GNUnet-SVN] r10631 - gnunet/src/core
Date: Wed, 17 Mar 2010 14:26:31 +0100

Author: grothoff
Date: 2010-03-17 14:26:31 +0100 (Wed, 17 Mar 2010)
New Revision: 10631

Modified:
   gnunet/src/core/gnunet-service-core.c
Log:
more stats

Modified: gnunet/src/core/gnunet-service-core.c
===================================================================
--- gnunet/src/core/gnunet-service-core.c       2010-03-17 09:51:00 UTC (rev 
10630)
+++ gnunet/src/core/gnunet-service-core.c       2010-03-17 13:26:31 UTC (rev 
10631)
@@ -1299,7 +1299,10 @@
     prev->next = n->next;
   GNUNET_assert (neighbour_count > 0);
   neighbour_count--;
-  GNUNET_STATISTICS_set (stats, gettext_noop ("# active neighbours"), 
neighbour_count, GNUNET_NO);
+  GNUNET_STATISTICS_set (stats,
+                        gettext_noop ("# active neighbours"), 
+                        neighbour_count,
+                        GNUNET_NO);
   free_neighbour (n);
 }
 
@@ -3051,6 +3054,7 @@
 deliver_message (struct Neighbour *sender,
                  const struct GNUNET_MessageHeader *m, size_t msize)
 {
+  char buf[256];
   struct Client *cpos;
   uint16_t type;
   unsigned int tpos;
@@ -3064,6 +3068,14 @@
              type,
              GNUNET_i2s (&sender->peer));
 #endif
+  GNUNET_snprintf (buf,
+                  sizeof(buf),
+                  gettext_noop ("# bytes of messages of type %u received"),
+                  type);
+  GNUNET_STATISTICS_set (stats,
+                        buf,
+                        msize,
+                        GNUNET_NO);     
   dropped = GNUNET_YES;
   cpos = clients;
   while (cpos != NULL)
@@ -3190,7 +3202,6 @@
   char buf[size];
   struct EncryptedMessage *pt;  /* plaintext */
   GNUNET_HashCode ph;
-  size_t off;
   uint32_t snum;
   struct GNUNET_TIME_Absolute t;
   GNUNET_HashCode iv;
@@ -3230,6 +3241,10 @@
       GNUNET_log (GNUNET_ERROR_TYPE_INFO,
                   "Received duplicate message, ignoring.\n");
       /* duplicate, ignore */
+      GNUNET_STATISTICS_set (stats,
+                            gettext_noop ("# bytes dropped (duplicates)"),
+                            size,
+                            GNUNET_NO);      
       return;
     }
   if ((n->last_sequence_number_received > snum) &&
@@ -3238,6 +3253,10 @@
       GNUNET_log (GNUNET_ERROR_TYPE_INFO,
                   "Received ancient out of sequence message, ignoring.\n");
       /* ancient out of sequence, ignore */
+      GNUNET_STATISTICS_set (stats,
+                            gettext_noop ("# bytes dropped (out of sequence)"),
+                            size,
+                            GNUNET_NO);      
       return;
     }
   if (n->last_sequence_number_received > snum)
@@ -3248,6 +3267,10 @@
         {
           GNUNET_log (GNUNET_ERROR_TYPE_INFO,
                       "Received duplicate message, ignoring.\n");
+         GNUNET_STATISTICS_set (stats,
+                                gettext_noop ("# bytes dropped (duplicates)"),
+                                size,
+                                GNUNET_NO);      
           /* duplicate, ignore */
           return;
         }
@@ -3267,6 +3290,10 @@
                   _
                   ("Message received far too old (%llu ms). Content 
ignored.\n"),
                   GNUNET_TIME_absolute_get_duration (t).value);
+      GNUNET_STATISTICS_set (stats,
+                            gettext_noop ("# bytes dropped (ancient message)"),
+                            size,
+                            GNUNET_NO);      
       return;
     }
 
@@ -3299,8 +3326,11 @@
                                    GNUNET_TIME_relative_divide 
(GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT, 2),
                                    &send_keep_alive,
                                    n);
-  off = sizeof (struct EncryptedMessage);
-  deliver_messages (n, buf, size, off);
+  GNUNET_STATISTICS_set (stats,
+                        gettext_noop ("# bytes of payload decrypted"),
+                        size - sizeof (struct EncryptedMessage),
+                        GNUNET_NO);      
+  deliver_messages (n, buf, size, sizeof (struct EncryptedMessage));
 }
 
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]