summaryrefslogtreecommitdiff
path: root/src/benchmark
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2018-10-02 21:08:59 +0200
committerFlorian Dold <florian.dold@gmail.com>2018-10-02 21:08:59 +0200
commit34f12d3f069cd22d9307b23fdd3cfd5fc6aeb758 (patch)
tree4251c9518e00ce99a6472412f8225c49d8524b6b /src/benchmark
parentb7bbc4cc701e0a38415f68fb962dd5bd79dcc87b (diff)
downloadexchange-34f12d3f069cd22d9307b23fdd3cfd5fc6aeb758.tar.gz
exchange-34f12d3f069cd22d9307b23fdd3cfd5fc6aeb758.tar.bz2
exchange-34f12d3f069cd22d9307b23fdd3cfd5fc6aeb758.zip
benchmark: variable 'refresh rate'
Diffstat (limited to 'src/benchmark')
-rw-r--r--src/benchmark/taler-exchange-benchmark.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/benchmark/taler-exchange-benchmark.c b/src/benchmark/taler-exchange-benchmark.c
index 031b68a3..24799703 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