diff options
author | Florian Dold <florian.dold@gmail.com> | 2018-10-02 21:08:59 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2018-10-02 21:08:59 +0200 |
commit | 34f12d3f069cd22d9307b23fdd3cfd5fc6aeb758 (patch) | |
tree | 4251c9518e00ce99a6472412f8225c49d8524b6b | |
parent | b7bbc4cc701e0a38415f68fb962dd5bd79dcc87b (diff) |
benchmark: variable 'refresh rate'
-rw-r--r-- | src/benchmark/taler-exchange-benchmark.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/benchmark/taler-exchange-benchmark.c b/src/benchmark/taler-exchange-benchmark.c index 031b68a33..24799703c 100644 --- a/src/benchmark/taler-exchange-benchmark.c +++ b/src/benchmark/taler-exchange-benchmark.c @@ -50,11 +50,6 @@ enum BenchmarkError { /** - * Probability that a spent coin will be refreshed. - */ -#define REFRESH_PROBABILITY 0.1 - -/** * The whole benchmark is a repetition of a "unit". Each * unit is a array containing a withdraw+deposit operation, * and _possibly_ a refresh of the deposited coin. @@ -155,6 +150,11 @@ static unsigned int howmany_coins = 1; static unsigned int howmany_reserves = 1; /** + * Probability (in percent) of refreshing per spent coin. + */ +static unsigned int refresh_rate = 10; + +/** * How many clients we want to create. */ static unsigned int howmany_clients = 1; @@ -441,7 +441,7 @@ run (void *cls, AMOUNT_1, MHD_HTTP_OK)); - if (eval_probability (REFRESH_PROBABILITY)) + if (eval_probability (refresh_rate / 100.0)) { char *melt_label; char *reveal_label; @@ -831,6 +831,11 @@ main (int argc, "NRESERVES", "How many reserves per client we should create", &howmany_reserves), + GNUNET_GETOPT_option_uint ('R', + "refresh-rate", + "RATE", + "Probability of refresh per coin (0-100)", + &refresh_rate), GNUNET_GETOPT_option_string ('m', "mode", "MODE", @@ -1006,7 +1011,7 @@ main (int argc, "Executed (Withdraw=%u, Deposit=%u, Refresh~=%5.2f) * Reserve=%u * Parallel=%u, operations in %s\n", howmany_coins, howmany_coins, - (float) howmany_coins * REFRESH_PROBABILITY, + (float) howmany_coins * (refresh_rate / 100.0), howmany_reserves, howmany_clients, GNUNET_STRINGS_relative_time_to_string |