gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r34200 - gnunet/src/dht


From: gnunet
Subject: [GNUnet-SVN] r34200 - gnunet/src/dht
Date: Fri, 22 Aug 2014 16:22:59 +0200

Author: harsha
Date: 2014-08-22 16:22:59 +0200 (Fri, 22 Aug 2014)
New Revision: 34200

Modified:
   gnunet/src/dht/gnunet_dht_profiler.c
Log:
Make the delays to start PUTs and GETs configurable as program parameters.


Modified: gnunet/src/dht/gnunet_dht_profiler.c
===================================================================
--- gnunet/src/dht/gnunet_dht_profiler.c        2014-08-22 14:03:08 UTC (rev 
34199)
+++ gnunet/src/dht/gnunet_dht_profiler.c        2014-08-22 14:22:59 UTC (rev 
34200)
@@ -177,9 +177,9 @@
 static struct ActiveContext *a_ac;
 
 /**
- * The delay between starting to do PUTS and GETS
+ * The delay between rounds for collecting statistics
  */
-static struct GNUNET_TIME_Relative delay;
+static struct GNUNET_TIME_Relative delay_stats;
 
 /**
  * The delay to start puts.
@@ -935,7 +935,7 @@
     else
     {
       flag = 0;
-      successor_stats_task = GNUNET_SCHEDULER_add_delayed (delay, 
&collect_stats, cls);
+      successor_stats_task = GNUNET_SCHEDULER_add_delayed (delay_stats, 
&collect_stats, cls);
     }
   } 
 }
@@ -1078,7 +1078,7 @@
      struct Collect_Stat_Context *collect_stat_cls = GNUNET_new(struct 
Collect_Stat_Context);
      collect_stat_cls->service_connect_ctx = cls;
      collect_stat_cls->op = op;
-     successor_stats_task = GNUNET_SCHEDULER_add_delayed (delay,
+     successor_stats_task = GNUNET_SCHEDULER_add_delayed (delay_stats,
                                                           &collect_stats,
                                                           collect_stat_cls);
   }
@@ -1220,14 +1220,20 @@
     {'H', "hosts", "FILENAME",
      gettext_noop ("name of the file with the login information for the 
testbed"),
      1, &GNUNET_GETOPT_set_string, &hosts_file},
-    {'d', "delay", "DELAY",
-     gettext_noop ("delay for starting DHT PUT and GET"),
-     1, &GNUNET_GETOPT_set_relative_time, &delay},
+    {'D', "delay", "DELAY",
+     gettext_noop ("delay between rounds for collecting statistics (default: 
30 sec)"),
+     1, &GNUNET_GETOPT_set_relative_time, &delay_stats},
+    {'P', "PUT-delay", "DELAY",
+     gettext_noop ("delay to start doing PUTs (default: 1 sec)"),
+     1, &GNUNET_GETOPT_set_relative_time, &delay_put},
+    {'G', "GET-delay", "DELAY",
+     gettext_noop ("delay to start doing GETs (default: 5 min)"),
+     1, &GNUNET_GETOPT_set_relative_time, &delay_get},
     {'r', "replication", "DEGREE",
      gettext_noop ("replication degree for DHT PUTs"),
      1, &GNUNET_GETOPT_set_uint, &replication},
     {'t', "timeout", "TIMEOUT",
-     gettext_noop ("timeout for DHT PUT and GET requests"),
+     gettext_noop ("timeout for DHT PUT and GET requests (default: 1 min)"),
      1, &GNUNET_GETOPT_set_relative_time, &timeout},
     GNUNET_GETOPT_OPTION_END
   };
@@ -1235,10 +1241,11 @@
   max_searches = 5;
   if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
     return 2;
-  delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30); /* 
default delay */
-  delay_put = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1); /* 
default delay */
-  delay_get = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5); /* 
default delay */
-  timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 1); /* 
default timeout */
+  /* set default delays */
+  delay_stats = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30);
+  delay_put = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1);
+  delay_get = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5);
+  timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 1);
   replication = 1;      /* default replication */
   rc = 0;
   if (GNUNET_OK !=




reply via email to

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