gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-exchange] branch master updated: benchmark: variable


From: gnunet
Subject: [GNUnet-SVN] [taler-exchange] branch master updated: benchmark: variable 'refresh rate'
Date: Tue, 02 Oct 2018 21:10:36 +0200

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 34f12d3f benchmark: variable 'refresh rate'
34f12d3f is described below

commit 34f12d3f069cd22d9307b23fdd3cfd5fc6aeb758
Author: Florian Dold <address@hidden>
AuthorDate: Tue Oct 2 21:08:59 2018 +0200

    benchmark: variable 'refresh rate'
---
 src/benchmark/taler-exchange-benchmark.c | 19 ++++++++++++-------
 1 file 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

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]