diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2014-08-22 14:22:59 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2014-08-22 14:22:59 +0000 |
commit | 32238c161b4b2bc0980caf69340da9f9d3042ab5 (patch) | |
tree | ba3858a0deef8f394e8fdca5d591efcaf6eadf80 /src/dht/gnunet_dht_profiler.c | |
parent | 835ecdcc41a52e17fb4dc76fbd8a432384f4e193 (diff) | |
download | gnunet-32238c161b4b2bc0980caf69340da9f9d3042ab5.tar.gz gnunet-32238c161b4b2bc0980caf69340da9f9d3042ab5.zip |
Make the delays to start PUTs and GETs configurable as program parameters.
Diffstat (limited to 'src/dht/gnunet_dht_profiler.c')
-rw-r--r-- | src/dht/gnunet_dht_profiler.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/src/dht/gnunet_dht_profiler.c b/src/dht/gnunet_dht_profiler.c index 3b6ea6b0c..a9c84b723 100644 --- a/src/dht/gnunet_dht_profiler.c +++ b/src/dht/gnunet_dht_profiler.c | |||
@@ -177,9 +177,9 @@ static struct Context *a_ctx; | |||
177 | static struct ActiveContext *a_ac; | 177 | static struct ActiveContext *a_ac; |
178 | 178 | ||
179 | /** | 179 | /** |
180 | * The delay between starting to do PUTS and GETS | 180 | * The delay between rounds for collecting statistics |
181 | */ | 181 | */ |
182 | static struct GNUNET_TIME_Relative delay; | 182 | static struct GNUNET_TIME_Relative delay_stats; |
183 | 183 | ||
184 | /** | 184 | /** |
185 | * The delay to start puts. | 185 | * The delay to start puts. |
@@ -935,7 +935,7 @@ successor_stats_cont (void *cls, | |||
935 | else | 935 | else |
936 | { | 936 | { |
937 | flag = 0; | 937 | flag = 0; |
938 | successor_stats_task = GNUNET_SCHEDULER_add_delayed (delay, &collect_stats, cls); | 938 | successor_stats_task = GNUNET_SCHEDULER_add_delayed (delay_stats, &collect_stats, cls); |
939 | } | 939 | } |
940 | } | 940 | } |
941 | } | 941 | } |
@@ -1078,7 +1078,7 @@ service_started (void *cls, | |||
1078 | struct Collect_Stat_Context *collect_stat_cls = GNUNET_new(struct Collect_Stat_Context); | 1078 | struct Collect_Stat_Context *collect_stat_cls = GNUNET_new(struct Collect_Stat_Context); |
1079 | collect_stat_cls->service_connect_ctx = cls; | 1079 | collect_stat_cls->service_connect_ctx = cls; |
1080 | collect_stat_cls->op = op; | 1080 | collect_stat_cls->op = op; |
1081 | successor_stats_task = GNUNET_SCHEDULER_add_delayed (delay, | 1081 | successor_stats_task = GNUNET_SCHEDULER_add_delayed (delay_stats, |
1082 | &collect_stats, | 1082 | &collect_stats, |
1083 | collect_stat_cls); | 1083 | collect_stat_cls); |
1084 | } | 1084 | } |
@@ -1220,14 +1220,20 @@ main (int argc, char *const *argv) | |||
1220 | {'H', "hosts", "FILENAME", | 1220 | {'H', "hosts", "FILENAME", |
1221 | gettext_noop ("name of the file with the login information for the testbed"), | 1221 | gettext_noop ("name of the file with the login information for the testbed"), |
1222 | 1, &GNUNET_GETOPT_set_string, &hosts_file}, | 1222 | 1, &GNUNET_GETOPT_set_string, &hosts_file}, |
1223 | {'d', "delay", "DELAY", | 1223 | {'D', "delay", "DELAY", |
1224 | gettext_noop ("delay for starting DHT PUT and GET"), | 1224 | gettext_noop ("delay between rounds for collecting statistics (default: 30 sec)"), |
1225 | 1, &GNUNET_GETOPT_set_relative_time, &delay}, | 1225 | 1, &GNUNET_GETOPT_set_relative_time, &delay_stats}, |
1226 | {'P', "PUT-delay", "DELAY", | ||
1227 | gettext_noop ("delay to start doing PUTs (default: 1 sec)"), | ||
1228 | 1, &GNUNET_GETOPT_set_relative_time, &delay_put}, | ||
1229 | {'G', "GET-delay", "DELAY", | ||
1230 | gettext_noop ("delay to start doing GETs (default: 5 min)"), | ||
1231 | 1, &GNUNET_GETOPT_set_relative_time, &delay_get}, | ||
1226 | {'r', "replication", "DEGREE", | 1232 | {'r', "replication", "DEGREE", |
1227 | gettext_noop ("replication degree for DHT PUTs"), | 1233 | gettext_noop ("replication degree for DHT PUTs"), |
1228 | 1, &GNUNET_GETOPT_set_uint, &replication}, | 1234 | 1, &GNUNET_GETOPT_set_uint, &replication}, |
1229 | {'t', "timeout", "TIMEOUT", | 1235 | {'t', "timeout", "TIMEOUT", |
1230 | gettext_noop ("timeout for DHT PUT and GET requests"), | 1236 | gettext_noop ("timeout for DHT PUT and GET requests (default: 1 min)"), |
1231 | 1, &GNUNET_GETOPT_set_relative_time, &timeout}, | 1237 | 1, &GNUNET_GETOPT_set_relative_time, &timeout}, |
1232 | GNUNET_GETOPT_OPTION_END | 1238 | GNUNET_GETOPT_OPTION_END |
1233 | }; | 1239 | }; |
@@ -1235,10 +1241,11 @@ main (int argc, char *const *argv) | |||
1235 | max_searches = 5; | 1241 | max_searches = 5; |
1236 | if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) | 1242 | if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) |
1237 | return 2; | 1243 | return 2; |
1238 | delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30); /* default delay */ | 1244 | /* set default delays */ |
1239 | delay_put = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1); /* default delay */ | 1245 | delay_stats = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30); |
1240 | delay_get = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5); /* default delay */ | 1246 | delay_put = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1); |
1241 | timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 1); /* default timeout */ | 1247 | delay_get = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5); |
1248 | timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 1); | ||
1242 | replication = 1; /* default replication */ | 1249 | replication = 1; /* default replication */ |
1243 | rc = 0; | 1250 | rc = 0; |
1244 | if (GNUNET_OK != | 1251 | if (GNUNET_OK != |