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.


From: gnunet
Subject: [GNUnet-SVN] [taler-exchange] branch master updated: Benchmark.
Date: Wed, 25 Jul 2018 11:45:34 +0200

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

marcello pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 207c975  Benchmark.
207c975 is described below

commit 207c97590234a9ec0c42af960344444f32ee8d27
Author: Marcello Stanisci <address@hidden>
AuthorDate: Wed Jul 25 11:45:14 2018 +0200

    Benchmark.
    
    Measuring time and print outcome.
---
 src/benchmark/taler-exchange-benchmark-new.c | 36 +++++++++++++++++++++++-----
 1 file changed, 30 insertions(+), 6 deletions(-)

diff --git a/src/benchmark/taler-exchange-benchmark-new.c 
b/src/benchmark/taler-exchange-benchmark-new.c
index df3770c..9cdd26d 100644
--- a/src/benchmark/taler-exchange-benchmark-new.c
+++ b/src/benchmark/taler-exchange-benchmark-new.c
@@ -48,15 +48,10 @@ enum BenchmarkError {
 };
 
 /**
- * Probability a coin can be refreshed.
- * This probability multiplied by the number of coins
- * generated during the average refresh must be smaller
- * than one.  The variance must be covered by the
- * #INVALID_COIN_SLACK.
+ * 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,
@@ -82,6 +77,18 @@ enum BenchmarkError {
      bank_url, USER_ACCOUNT_NO, EXCHANGE_ACCOUNT_NO, \
      USER_LOGIN_NAME, USER_LOGIN_PASS, EXCHANGE_URL)
 
+
+/**
+ * Time snapshot taken right before executing the CMDs.
+ */
+static struct GNUNET_TIME_Absolute start_time;
+
+/**
+ * Benchmark duration time taken right after the CMD interpreter
+ * returns.
+ */
+static struct GNUNET_TIME_Relative duration;
+
 /**
  * Exit code.
  */
@@ -93,6 +100,11 @@ static unsigned int result;
 static struct GNUNET_OS_Process *bankd;
 
 /**
+ * How many refreshes got executed.
+ */
+static unsigned int howmany_refreshes;
+
+/**
  * How many coins we want to create.
  */
 static unsigned int howmany_coins = 1;
@@ -258,6 +270,7 @@ run (void *cls,
       char *melt_label;
       char *reveal_label;
 
+      howmany_refreshes++;
       GNUNET_asprintf (&melt_label,
                        "refresh-melt-%u",
                        i);
@@ -293,6 +306,8 @@ run (void *cls,
                                                    unit);
   }
   all_commands[1 + howmany_coins] = TALER_TESTING_cmd_end ();
+
+  start_time = GNUNET_TIME_absolute_get ();
   TALER_TESTING_run (is,
                      all_commands);
   result = 1;
@@ -424,7 +439,16 @@ main (int argc,
      NULL,
      cfg_filename);
 
+  duration = GNUNET_TIME_absolute_get_duration (start_time);
   terminate_process (bankd);
 
+  TALER_LOG_INFO ("Executed W=%u, D=%u, R=%u, operations in %s\n",
+                  howmany_coins,
+                  howmany_coins,
+                  howmany_refreshes,
+                  GNUNET_STRINGS_relative_time_to_string
+                    (duration,
+                     GNUNET_YES));
+
   return (GNUNET_OK == result) ? 0 : result;
 }

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



reply via email to

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