aboutsummaryrefslogtreecommitdiff
path: root/src/ats-tests/perf_ats.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2013-09-19 12:25:28 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2013-09-19 12:25:28 +0000
commit9daee8a187e78bd9e860f2f34729e80cc95f414c (patch)
treef059b5d84fc7bcf996b6e3e2fe9445fc47e89707 /src/ats-tests/perf_ats.c
parent33d7922f5f3ebbf4239f105b7cf030f3e3cc7733 (diff)
downloadgnunet-9daee8a187e78bd9e860f2f34729e80cc95f414c.tar.gz
gnunet-9daee8a187e78bd9e860f2f34729e80cc95f414c.zip
added logging frequency
Diffstat (limited to 'src/ats-tests/perf_ats.c')
-rw-r--r--src/ats-tests/perf_ats.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/ats-tests/perf_ats.c b/src/ats-tests/perf_ats.c
index c4689ad0c..e6c878b64 100644
--- a/src/ats-tests/perf_ats.c
+++ b/src/ats-tests/perf_ats.c
@@ -151,6 +151,11 @@ static struct BenchmarkPeer *sps;
151static struct GNUNET_TIME_Relative perf_duration; 151static struct GNUNET_TIME_Relative perf_duration;
152 152
153/** 153/**
154 * Logging frequency
155 */
156static struct GNUNET_TIME_Relative log_frequency;
157
158/**
154 * Benchmark state 159 * Benchmark state
155 */ 160 */
156static struct BenchmarkState state; 161static struct BenchmarkState state;
@@ -456,7 +461,7 @@ do_benchmark ()
456 mps[c_m].ats_task = GNUNET_SCHEDULER_add_now (&ats_pref_task, &mps[c_m]); 461 mps[c_m].ats_task = GNUNET_SCHEDULER_add_now (&ats_pref_task, &mps[c_m]);
457 } 462 }
458 if (GNUNET_YES == logging) 463 if (GNUNET_YES == logging)
459 perf_logging_start (testname, mps, num_masters); 464 perf_logging_start (log_frequency, testname, mps, num_masters);
460 465
461} 466}
462 467
@@ -1229,6 +1234,26 @@ main (int argc, char *argv[])
1229 logging = GNUNET_YES; 1234 logging = GNUNET_YES;
1230 } 1235 }
1231 1236
1237 if (GNUNET_YES == logging)
1238 {
1239 for (c = 0; c < (argc - 1); c++)
1240 {
1241 if (0 == strcmp (argv[c], "-f"))
1242 break;
1243 }
1244 if (c < argc - 1)
1245 {
1246 if (GNUNET_OK != GNUNET_STRINGS_fancy_time_to_relative (argv[c + 1], &log_frequency))
1247 fprintf (stderr, "Failed to parse duration `%s'\n", argv[c + 1]);
1248 }
1249 else
1250 {
1251 log_frequency = LOGGING_FREQUENCY;
1252 }
1253 fprintf (stderr, "Using log frequency %llu ms\n",
1254 (unsigned long long) (log_frequency.rel_value_us) / (1000));
1255 }
1256
1232 GNUNET_asprintf (&testname, "%s_%s_%s",solver, comm_name, pref_str); 1257 GNUNET_asprintf (&testname, "%s_%s_%s",solver, comm_name, pref_str);
1233 1258
1234 if (num_slaves < num_masters) 1259 if (num_slaves < num_masters)