gnunet-svn
[Top][All Lists]
Advanced

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

[taler-wallet-core] branch master updated: wallet-cli: run benchmark in


From: gnunet
Subject: [taler-wallet-core] branch master updated: wallet-cli: run benchmark in a loop
Date: Wed, 20 Oct 2021 13:27:53 +0200

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

dold pushed a commit to branch master
in repository wallet-core.

The following commit(s) were added to refs/heads/master by this push:
     new cf25f569 wallet-cli: run benchmark in a loop
cf25f569 is described below

commit cf25f5698e9f3a3b36930e545f7cce9829fb08f6
Author: Florian Dold <florian@dold.me>
AuthorDate: Wed Oct 20 13:27:47 2021 +0200

    wallet-cli: run benchmark in a loop
---
 packages/taler-wallet-cli/src/bench1.ts | 48 ++++++++++++++++++++++-----------
 1 file changed, 32 insertions(+), 16 deletions(-)

diff --git a/packages/taler-wallet-cli/src/bench1.ts 
b/packages/taler-wallet-cli/src/bench1.ts
index 5563fc45..4a2651f3 100644
--- a/packages/taler-wallet-cli/src/bench1.ts
+++ b/packages/taler-wallet-cli/src/bench1.ts
@@ -17,7 +17,12 @@
 /**
  * Imports.
  */
-import { buildCodecForObject, codecForString } from "@gnu-taler/taler-util";
+import {
+  buildCodecForObject,
+  codecForNumber,
+  codecForString,
+  codecOptional,
+} from "@gnu-taler/taler-util";
 import {
   getDefaultNodeWallet,
   NodeHttpLib,
@@ -42,24 +47,28 @@ export async function runBench1(configJson: any): 
Promise<void> {
   });
   await wallet.client.call(WalletApiOperation.InitWallet, {});
 
-  await wallet.client.call(WalletApiOperation.WithdrawFakebank, {
-    amount: "TESTKUDOS:10",
-    bank: b1conf.bank,
-    exchange: b1conf.exchange,
-  });
+  const numIter = b1conf.iterations ?? 1;
 
-  await wallet.runTaskLoop({
-    stopWhenDone: true,
-  });
+  for (let i = 0; i < numIter; i++) {
+    await wallet.client.call(WalletApiOperation.WithdrawFakebank, {
+      amount: "TESTKUDOS:10",
+      bank: b1conf.bank,
+      exchange: b1conf.exchange,
+    });
 
-  await wallet.client.call(WalletApiOperation.CreateDepositGroup, {
-    amount: "TESTKUDOS:5",
-    depositPaytoUri: "payto://x-taler-bank/localhost/foo",
-  });
+    await wallet.runTaskLoop({
+      stopWhenDone: true,
+    });
 
-  await wallet.runTaskLoop({
-    stopWhenDone: true,
-  });
+    await wallet.client.call(WalletApiOperation.CreateDepositGroup, {
+      amount: "TESTKUDOS:5",
+      depositPaytoUri: "payto://x-taler-bank/localhost/foo",
+    });
+
+    await wallet.runTaskLoop({
+      stopWhenDone: true,
+    });
+  }
 
   wallet.stop();
 }
@@ -77,6 +86,12 @@ interface Bench1Config {
    * Base URL of the exchange.
    */
   exchange: string;
+
+  /**
+   * How many withdraw/deposit iterations should be made?
+   * Defaults to 1.
+   */
+  iterations?: number;
 }
 
 /**
@@ -86,4 +101,5 @@ const codecForBench1Config = () =>
   buildCodecForObject<Bench1Config>()
     .property("bank", codecForString())
     .property("exchange", codecForString())
+    .property("iterations", codecOptional(codecForNumber()))
     .build("Bench1Config");

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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