gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r2789 - in GNUnet: contrib src/applications/fs/tools src/ap


From: grothoff
Subject: [GNUnet-SVN] r2789 - in GNUnet: contrib src/applications/fs/tools src/applications/gap
Date: Sat, 13 May 2006 15:55:40 -0700 (PDT)

Author: grothoff
Date: 2006-05-13 15:55:35 -0700 (Sat, 13 May 2006)
New Revision: 2789

Modified:
   GNUnet/contrib/effectiveness
   GNUnet/src/applications/fs/tools/gnunet-insert.c
   GNUnet/src/applications/gap/gap.c
Log:
more useful stats

Modified: GNUnet/contrib/effectiveness
===================================================================
--- GNUnet/contrib/effectiveness        2006-05-13 21:41:29 UTC (rev 2788)
+++ GNUnet/contrib/effectiveness        2006-05-13 22:55:35 UTC (rev 2789)
@@ -1,5 +1,10 @@
 #!/bin/sh
 FWD=`gnunet-stats | grep gap | grep forwarded | awk '{ print $9 }'`
 SUC=`gnunet-stats | grep gap | grep success | awk '{ print $7 }'`
+LOC=`gnunet-stats | grep gap | grep local | awk '{ print $8 }'`
+UP=`gnunet-stats | grep Uptime | awk '{ print $4 }'`
 RAT=`calc $FWD / $SUC`
-echo "GNUnet routing effectiveness: $RAT"
+RRAT=`calc $FWD / \( $SUC - $LOC \)`
+echo "Uptime                             : ${UP}s"
+echo "GNUnet total  routing effectiveness: $RAT = $FWD / $SUC"
+echo "GNUnet remote routing effectiveness: $RRAT = $FWD / ($SUC - $LOC)"
\ No newline at end of file

Modified: GNUnet/src/applications/fs/tools/gnunet-insert.c
===================================================================
--- GNUnet/src/applications/fs/tools/gnunet-insert.c    2006-05-13 21:41:29 UTC 
(rev 2788)
+++ GNUnet/src/applications/fs/tools/gnunet-insert.c    2006-05-13 22:55:35 UTC 
(rev 2789)
@@ -426,7 +426,7 @@
                           EXTRACTOR_UNKNOWN,
                           tmp);
        FREE(tmp);
-       printf(("Unknown meta-data type in meta-data option `%s'.  Using 
unknown.\n"),
+       printf(_("Unknown metadata type in metadata option `%s'.  Using 
metadata type `unknown' instead.\n"),
               GNoptarg);
       }
       break;

Modified: GNUnet/src/applications/gap/gap.c
===================================================================
--- GNUnet/src/applications/gap/gap.c   2006-05-13 21:41:29 UTC (rev 2788)
+++ GNUnet/src/applications/gap/gap.c   2006-05-13 22:55:35 UTC (rev 2789)
@@ -761,9 +761,9 @@
  *  which in turn wraps the DBlock (including
  *  the type ID).
  */
-static void queueReply(const PeerIdentity * sender,
-                      const HashCode512 * primaryKey,
-                      const DataContainer * data) {
+static int queueReply(const PeerIdentity * sender,
+                     const HashCode512 * primaryKey,
+                     const DataContainer * data) {
   P2P_gap_reply_MESSAGE * pmsg;
   IndirectionTableEntry * ite;
   unsigned int size;
@@ -792,21 +792,21 @@
     LOG(LOG_DEBUG,
        "GAP: Dropping reply, routing table has no query associated with it 
(anymore)\n");
 #endif
-    return; /* we don't care for the reply (anymore) */
+    return NO; /* we don't care for the reply (anymore) */
   }
   if (YES == ite->successful_local_lookup_in_delay_loop) {
 #if DEBUG_GAP
     LOG(LOG_DEBUG,
        "GAP: Dropping reply, found reply locally during delay\n");
 #endif
-    return; /* wow, really bad concurrent DB lookup and processing for
-              the same query.  Well, at least we should not also
-              queue the delayed reply twice... */
+    return NO; /* wow, really bad concurrent DB lookup and processing for
+                 the same query.  Well, at least we should not also
+                 queue the delayed reply twice... */
   }
   size = sizeof(P2P_gap_reply_MESSAGE) + ntohl(data->size) - 
sizeof(DataContainer);
   if (size >= MAX_BUFFER_SIZE) {
     BREAK();
-    return;
+    return SYSERR;
   }
   ite->successful_local_lookup_in_delay_loop = YES;
   pmsg = MALLOC(size);
@@ -825,6 +825,7 @@
             weak_randomi(TTL_DECREMENT),
             0,
             pmsg);
+  return YES;
 }
 
 static void addReward(const HashCode512 * query,
@@ -1468,8 +1469,6 @@
   }
 
   if (cls.valueCount > 0) {
-    if (stats != NULL)
-      stats->change(stat_routing_local_results, 1);
     perm = permute(WEAK, cls.valueCount);
     max = getNetworkLoadDown();
     if (max > 100)
@@ -1483,12 +1482,13 @@
                                what we have */
 
     for (i=0;i<cls.valueCount;i++) {
-      if (i < max) {
-       if (sender != NULL)
-         queueReply(sender,
-                    &query->queries[0],
-                    cls.values[perm[i]]);
-      }
+      if ( (i < max) &&
+          (sender != NULL) &&
+          (YES == queueReply(sender,
+                             &query->queries[0],
+                             cls.values[perm[i]])) &&
+          (stats != NULL) )
+       stats->change(stat_routing_local_results, 1);      
       /* even for local results, always do 'put'
         (at least to give back results to local client &
         to update priority; but only do this for





reply via email to

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