From 1b24e2f9bb84d64ff07f28a330e1913de790df0c Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 20 Mar 2020 18:38:57 +0100 Subject: more statistics, make explicit table lock optional, can hurt performance badly --- src/benchmark/taler-exchange-benchmark.c | 35 ++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) (limited to 'src/benchmark/taler-exchange-benchmark.c') diff --git a/src/benchmark/taler-exchange-benchmark.c b/src/benchmark/taler-exchange-benchmark.c index 8bfbc42a5..307b0f378 100644 --- a/src/benchmark/taler-exchange-benchmark.c +++ b/src/benchmark/taler-exchange-benchmark.c @@ -175,6 +175,11 @@ static enum BenchmarkMode mode; */ static struct GNUNET_CONFIGURATION_Handle *cfg; +/** + * Should we create all of the reserves at the beginning? + */ +static int reserves_first; + /** * Currency used. */ @@ -297,9 +302,6 @@ eval_probability (float probability) } -static int reserves_first = 1; - - /** * Actual commands construction and execution. * @@ -467,14 +469,27 @@ static void print_stats (void) { for (unsigned int i = 0; NULL != timings[i].prefix; i++) + { + char *total; + char *latency; + + total = GNUNET_strdup ( + GNUNET_STRINGS_relative_time_to_string (timings[i].total_duration, + GNUNET_YES)); + latency = GNUNET_strdup ( + GNUNET_STRINGS_relative_time_to_string (timings[i].success_latency, + GNUNET_YES)); fprintf (stderr, - "%s-%d took %s in total for %u executions\n", + "%s-%d took %s in total with %s for latency for %u executions (%u repeats)\n", timings[i].prefix, (int) getpid (), - GNUNET_STRINGS_relative_time_to_string ( - timings[i].total_duration, - GNUNET_YES), - timings[i].num_commands); + total, + latency, + timings[i].num_commands, + timings[i].num_retries); + GNUNET_free (total); + GNUNET_free (latency); + } } @@ -959,6 +974,10 @@ main (int argc, "fakebank", "start a fakebank instead of the Python bank", &use_fakebank), + GNUNET_GETOPT_option_flag ('F', + "reserves-first", + "should all reserves be created first, before starting normal operations", + &reserves_first), GNUNET_GETOPT_option_flag ('K', "linger", "linger around until key press", -- cgit v1.2.3