gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r6315 - GNUnet/src/applications/fs/gap


From: gnunet
Subject: [GNUnet-SVN] r6315 - GNUnet/src/applications/fs/gap
Date: Fri, 15 Feb 2008 18:40:47 -0700 (MST)

Author: grothoff
Date: 2008-02-15 18:40:47 -0700 (Fri, 15 Feb 2008)
New Revision: 6315

Modified:
   GNUnet/src/applications/fs/gap/fs.c
   GNUnet/src/applications/fs/gap/gap.c
Log:
better stats

Modified: GNUnet/src/applications/fs/gap/fs.c
===================================================================
--- GNUnet/src/applications/fs/gap/fs.c 2008-02-16 01:36:22 UTC (rev 6314)
+++ GNUnet/src/applications/fs/gap/fs.c 2008-02-16 01:40:47 UTC (rev 6315)
@@ -78,8 +78,6 @@
 
 static int stat_gap_content_received;
 
-static int stat_gap_content_found_locally;
-
 static int stat_gap_trust_awarded;
 
 /**
@@ -671,13 +669,9 @@
       GNUNET_GE_BREAK_OP (ectx, 0);
       return GNUNET_SYSERR;     /* invalid! */
     }
-  if (stats != NULL)
-    {
-      if (sender != NULL)
-        stats->change (stat_gap_content_received, 1);
-      else
-        stats->change (stat_gap_content_found_locally, 1);
-    }
+  if ( (stats != NULL) &&
+       (sender != NULL) )
+    stats->change (stat_gap_content_received, 1);
   expiration = GNUNET_ntohll (msg->expiration);
   /* forward to other peers */
   prio = GNUNET_FS_GAP_handle_response (sender,
@@ -749,8 +743,6 @@
         stats->create (gettext_noop ("# gap requests dropped due to load"));
       stat_gap_content_received =
         stats->create (gettext_noop ("# gap content total received"));
-      stat_gap_content_received =
-        stats->create (gettext_noop ("# gap content found locally"));
       stat_gap_trust_awarded =
         stats->create (gettext_noop ("# gap total trust awarded"));
     }

Modified: GNUnet/src/applications/fs/gap/gap.c
===================================================================
--- GNUnet/src/applications/fs/gap/gap.c        2008-02-16 01:36:22 UTC (rev 
6314)
+++ GNUnet/src/applications/fs/gap/gap.c        2008-02-16 01:40:47 UTC (rev 
6315)
@@ -74,7 +74,9 @@
 
 static int stat_gap_query_refreshed;
 
+static int stat_gap_content_found_locally;
 
+
 static unsigned int
 get_table_index (const GNUNET_HashCode * key)
 {
@@ -93,6 +95,8 @@
 {
   GNUNET_MessageHeader *msg = cls;
 
+  if (stats != NULL)
+    stats->change (stat_gap_content_found_locally, 1);
   coreAPI->p2p_inject_message (NULL,
                                (const char *) msg,
                                ntohs (msg->size), GNUNET_YES, NULL);
@@ -563,6 +567,8 @@
         stats->create (gettext_noop ("# gap queries dropped (redundant)"));
       stat_gap_query_routed =
         stats->create (gettext_noop ("# gap queries routed"));
+      stat_gap_content_found_locally =
+        stats->create (gettext_noop ("# gap content found locally"));
       stat_gap_query_refreshed =
         stats->
         create (gettext_noop ("# gap queries refreshed existing record"));





reply via email to

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