stuff
authorChristian Grothoff <christian@grothoff.org>
Mon, 18 Oct 2010 11:29:48 +0000 (11:29 +0000)
committerChristian Grothoff <christian@grothoff.org>
Mon, 18 Oct 2010 11:29:48 +0000 (11:29 +0000)
src/fs/gnunet-service-fs.c
src/fs/perf_gnunet_service_fs_p2p.c

index 9f8ec98e307a37aceeb2a289640c03d8e12ad4ac..ad1fa44758623834d207cc1f8efa5f6564ce2cc1 100644 (file)
@@ -3019,6 +3019,9 @@ process_reply (void *cls,
   struct PutMessage *pm;
   struct ConnectedPeer *cp;
   struct GNUNET_TIME_Relative cur_delay;
+#if SUPPORT_DELAYS  
+struct GNUNET_TIME_Relative art_delay;
+#endif
   size_t msize;
 
 #if DEBUG_FS
@@ -3210,10 +3213,15 @@ process_reply (void *cls,
       reply->cont = &transmit_reply_continuation;
       reply->cont_cls = pr;
 #if SUPPORT_DELAYS
+      art_delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS,
+                                                GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK,
+                                                                          TTL_DECREMENT));
       reply->delay_until 
-       = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS,
-                                                                          GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK,
-                                                                                                    TTL_DECREMENT)));
+       = GNUNET_TIME_relative_to_absolute (art_delay);
+      GNUNET_STATISTICS_update (stats,
+                               gettext_noop ("cummulative artificial delay introduced (ms)"),
+                               art_delay.value,
+                               GNUNET_NO);
 #endif
       reply->msize = msize;
       reply->priority = UINT32_MAX; /* send replies first! */
index b836f6772b13f05c7aee91f34cd830d58d5e0435..70e7cdb31e265e39daa71d9c4aaf191b828496fd 100644 (file)
@@ -32,7 +32,7 @@
 /**
  * File-size we use for testing.
  */
-#define FILESIZE (1024 * 1024 * 1)
+#define FILESIZE (1024 * 1024 * 10)
 
 /**
  * How long until we give up on transmitting the message?
@@ -82,15 +82,21 @@ struct StatValues
  */
 static struct StatValues stats[] =
   {
-    { "fs", "queries forwarded"},
-    { "fs", "replies received and matched"},
-    { "core", "bytes decrypted"},
-    { "core", "bytes encrypted"},
-    { "transport", "bytes received via TCP"},
-    { "transport", "bytes transmitted via TCP"},
-    { "datacache", "bytes stored"},
-    { "dht", "DHT ROUTE Requests Seen"},
-    { "dht", "DHT ROUTE Requests Forwarded"},
+    { "fs", "# queries forwarded"},
+    { "fs", "# replies received and matched"},
+    { "fs", "# results found locally"},
+    { "fs", "# requests forwarded due to high load"},
+    { "fs", "# requests done for free (low load)"},
+    { "fs", "# P2P searches received"},
+    { "fs", "# replies received for local clients"},
+    { "fs", "cummulative artificial delay introduced (ms)"},
+    { "core", "# bytes decrypted"},
+    { "core", "# bytes encrypted"},
+    { "transport", "# bytes received via TCP"},
+    { "transport", "# bytes transmitted via TCP"},
+    { "datacache", "# bytes stored"},
+    { "dht", "# DHT ROUTE Requests Seen"},
+    { "dht", "# DHT ROUTE Requests Forwarded"},
     { NULL, NULL}
   };
 
@@ -114,7 +120,7 @@ print_stat (void *cls,
 {
   struct StatMaster *sm = cls;
   fprintf (stderr,
-          "Peer %3u: %8s/%40s = %llu\n",
+          "Peer %2u: %12s/%50s = %4llu\n",
           sm->daemon,
           subsystem,
           name,
@@ -154,8 +160,12 @@ stat_run (void *cls,
   if (stats[sm->value].name != NULL)
     {
       GNUNET_STATISTICS_get (sm->stat,
+#if 0
+                            NULL, NULL, 
+#else
                             stats[sm->value].subsystem,
                             stats[sm->value].name,
+#endif
                             GNUNET_TIME_UNIT_FOREVER_REL,
                             &get_done,
                             &print_stat, sm);
@@ -326,7 +336,7 @@ main (int argc, char *argv[])
     GNUNET_GETOPT_OPTION_END
   };
 
-  GNUNET_DISK_directory_remove ("/tmp/gnunet-perf-fs-lib/");
+  GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-lib/");
   GNUNET_log_setup ("perf_gnunet_service_fs_p2p", 
 #if VERBOSE
                    "DEBUG",
@@ -337,7 +347,7 @@ main (int argc, char *argv[])
   GNUNET_PROGRAM_run ((sizeof (argvx) / sizeof (char *)) - 1,
                       argvx, "perf-gnunet-service-fs-p2p",
                      "nohelp", options, &run, NULL);
-  GNUNET_DISK_directory_remove ("/tmp/gnunet-perf-fs-lib/");
+  GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-lib/");
   return ok;
 }