gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r5210 - GNUnet/src/server


From: gnunet
Subject: [GNUnet-SVN] r5210 - GNUnet/src/server
Date: Sun, 1 Jul 2007 18:57:15 -0600 (MDT)

Author: grothoff
Date: 2007-07-01 18:57:15 -0600 (Sun, 01 Jul 2007)
New Revision: 5210

Modified:
   GNUnet/src/server/handler.c
Log:
more

Modified: GNUnet/src/server/handler.c
===================================================================
--- GNUnet/src/server/handler.c 2007-07-02 00:50:24 UTC (rev 5209)
+++ GNUnet/src/server/handler.c 2007-07-02 00:57:15 UTC (rev 5210)
@@ -90,6 +90,12 @@
 
 static struct PTHREAD * threads_[THREAD_COUNT];
 
+#if TRACK_DISCARD
+static unsigned int discarded;
+static unsigned int blacklisted;
+static unsigned int accepted;
+#endif
+
 /**
  * Array of arrays of message handlers.
  */
@@ -596,12 +602,6 @@
  * (receive implementation).
  */
 void core_receive(P2P_PACKET * mp) {
-#if TRACK_DISCARD
-  static unsigned int discarded;
-  static unsigned int blacklisted;
-  static unsigned int accepted;
-#endif
-
   if ( (threads_running == NO) ||
        (mainShutdownSignal != NULL) ||
        (SYSERR == SEMAPHORE_DOWN(bufferQueueWrite_, NO)) ) {
@@ -617,6 +617,14 @@
     if (globalLock_ != NULL)
       MUTEX_LOCK(globalLock_);
     discarded++;
+    if (0 == discarded % 64)
+      GE_LOG(ectx,
+            GE_DEBUG | GE_DEVELOPER | GE_REQUEST,
+            "Accepted: %u discarded: %u blacklisted: %u, ratio: %f\n",
+            accepted,
+            discarded,
+            blacklisted,
+            1.0 * accepted / (blacklisted + discarded + 1)); 
     if (globalLock_ != NULL)
       MUTEX_UNLOCK(globalLock_);
 #endif
@@ -636,6 +644,14 @@
 #if TRACK_DISCARD
     MUTEX_LOCK(globalLock_);
     blacklisted++;
+    if (0 == blacklisted % 64)
+      GE_LOG(ectx,
+            GE_DEBUG | GE_DEVELOPER | GE_REQUEST,
+            "Accepted: %u discarded: %u blacklisted: %u, ratio: %f\n",
+            accepted,
+            discarded,
+            blacklisted,
+            1.0 * accepted / (blacklisted + discarded + 1)); 
     MUTEX_UNLOCK(globalLock_);
 #endif
     FREE(mp->msg);





reply via email to

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