gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r6326 - GNUnet/src/server
Date: Sat, 16 Feb 2008 14:12:22 -0700 (MST)

Author: grothoff
Date: 2008-02-16 14:12:22 -0700 (Sat, 16 Feb 2008)
New Revision: 6326

Modified:
   GNUnet/src/server/connection.c
Log:
more stats

Modified: GNUnet/src/server/connection.c
===================================================================
--- GNUnet/src/server/connection.c      2008-02-16 21:03:06 UTC (rev 6325)
+++ GNUnet/src/server/connection.c      2008-02-16 21:12:22 UTC (rev 6326)
@@ -659,6 +659,16 @@
 
 static int stat_closedTransport;
 
+static int stat_shutdown_excessive_bandwidth;
+
+static int stat_shutdown_insufficient_bandwidth;
+
+static int stat_shutdown_timeout;
+
+static int stat_shutdown_connect_timeout;
+
+static int stat_shutdown_hangup_received;
+
 static int stat_encrypted;
 
 static int stat_transmitted;
@@ -2499,6 +2509,8 @@
 #endif
               identity->blacklistHost (&entries[u]->session.sender, 24 * 60 * 
60,       /* 1 day */
                                        GNUNET_YES);
+             if (stats != NULL)
+               stats->change(stat_shutdown_excessive_bandwidth, 1);
               shutdownConnection (entries[u]);
               activePeerCount--;
               entries[u] = entries[activePeerCount];
@@ -2778,6 +2790,8 @@
           identity->blacklistHost (&be->session.sender,
                                    SECONDS_BLACKLIST_AFTER_DISCONNECT,
                                    GNUNET_YES);
+         if (stats != NULL)
+           stats->change(stat_shutdown_insufficient_bandwidth, 1);
           shutdownConnection (be);
         }
       else
@@ -2894,6 +2908,8 @@
                   identity->blacklistHost (&root->session.sender,
                                            SECONDS_BLACKLIST_AFTER_DISCONNECT,
                                            GNUNET_YES);
+                 if (stats != NULL)
+                   stats->change(stat_shutdown_timeout, 1);
                   shutdownConnection (root);
                 }
               if ((root->consider_transport_switch == GNUNET_YES)
@@ -2999,6 +3015,8 @@
                   identity->blacklistHost (&root->session.sender,
                                            
SECONDS_BLACKLIST_AFTER_FAILED_CONNECT,
                                            GNUNET_NO);
+                 if (stats != NULL)
+                   stats->change(stat_shutdown_connect_timeout, 1);
                   shutdownConnection (root);
                 }
               break;
@@ -3237,6 +3255,8 @@
   /* do not try to reconnect any time soon! */
   identity->blacklistHost (&be->session.sender,
                            SECONDS_BLACKLIST_AFTER_DISCONNECT, GNUNET_YES);
+  if (stats != NULL)
+    stats->change(stat_shutdown_hangup_received, 1);
   shutdownConnection (be);
   GNUNET_mutex_unlock (lock);
   return GNUNET_OK;
@@ -3744,6 +3764,21 @@
       stat_avg_lifetime =
         stats->
         create (gettext_noop ("# average connection lifetime (in ms)"));
+      stat_shutdown_excessive_bandwidth =
+        stats->
+        create (gettext_noop ("# connections shutdown because other peer sent 
too much"));
+      stat_shutdown_insufficient_bandwidth =
+        stats->
+        create (gettext_noop ("# connections shutdown because we lacked 
bandwidth"));
+      stat_shutdown_timeout =
+        stats->
+        create (gettext_noop ("# connections shutdown because other peer timed 
out"));
+      stat_shutdown_connect_timeout =
+        stats->
+        create (gettext_noop ("# connections shutdown because other peer timed 
out during connect"));
+      stat_shutdown_hangup_received =
+        stats->
+        create (gettext_noop ("# connections shutdown because other peer 
requested it"));
     }
   transport->start (&GNUNET_CORE_p2p_receive);
   EXIT ();





reply via email to

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