gnunet-svn
[Top][All Lists]
Advanced

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

[taler-wallet-core] branch master updated (9f0429cb -> 525fcc48)


From: gnunet
Subject: [taler-wallet-core] branch master updated (9f0429cb -> 525fcc48)
Date: Thu, 18 Nov 2021 13:52:36 +0100

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

marco-boss pushed a change to branch master
in repository wallet-core.

    from 9f0429cb wallet: implement exchange protocol v9
     new fb23bab6 update bench1 config
     new 4b05ba00 remove string()
     new dce86113 disable throttling for bench1
     new 8d9386ac start a new wallet for each iteration
     new 98064f06 added some logging messages
     new 42cf0c44 added timestamps to logs
     new 8dadd89e timeEnd
     new 612275df update time calculation
     new ba198eab purge wallet after a specified amount of iterations
     new f8c0242f fix wallet.stop
     new 525fcc48 Merge benchmark implementation for Grid5000

The 11 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 packages/taler-wallet-cli/src/bench1.ts | 81 +++++++++++++++++++++++++++------
 1 file changed, 66 insertions(+), 15 deletions(-)

diff --git a/packages/taler-wallet-cli/src/bench1.ts 
b/packages/taler-wallet-cli/src/bench1.ts
index ad95eebc..30ef8732 100644
--- a/packages/taler-wallet-cli/src/bench1.ts
+++ b/packages/taler-wallet-cli/src/bench1.ts
@@ -22,11 +22,13 @@ import {
   codecForNumber,
   codecForString,
   codecOptional,
+  Logger,
 } from "@gnu-taler/taler-util";
 import {
   getDefaultNodeWallet,
   NodeHttpLib,
   WalletApiOperation,
+  Wallet,
 } from "@gnu-taler/taler-wallet-core";
 
 /**
@@ -36,6 +38,9 @@ import {
  * set up its own services.
  */
 export async function runBench1(configJson: any): Promise<void> {
+
+  const logger = new Logger("Bench1");
+
   // Validate the configuration file for this benchmark.
   const b1conf = codecForBench1Config().decode(configJson);
 
@@ -43,17 +48,36 @@ export async function runBench1(configJson: any): 
Promise<void> {
   myHttpLib.setThrottling(false);
 
   const numIter = b1conf.iterations ?? 1;
+  const numDeposits = b1conf.deposits ?? 5;
+  const restartWallet = b1conf.restartAfter ?? 20;
+
+  const withdrawAmount = (numDeposits + 1) * 10;
+
+  logger.info(`Starting Benchmark iterations=${numIter} 
deposits=${numDeposits}`);
+
+  let wallet = {} as Wallet;
 
   for (let i = 0; i < numIter; i++) {
-    const wallet = await getDefaultNodeWallet({
-      // No persistent DB storage.
-      persistentStoragePath: undefined,
-      httpLib: myHttpLib,
-    });
-    await wallet.client.call(WalletApiOperation.InitWallet, {});
+    // Create a new wallet in each iteration 
+    // otherwise the TPS go down 
+    // my assumption is that the in-memory db file gets too large 
+    if (i % restartWallet == 0) {
+      if (Object.keys(wallet).length !== 0) {
+             wallet.stop();
+      }
+      wallet = await getDefaultNodeWallet({
+        // No persistent DB storage.
+        persistentStoragePath: undefined,
+        httpLib: myHttpLib,
+      });
+      await wallet.client.call(WalletApiOperation.InitWallet, {});
+    }
+       
+    logger.trace(`Starting withdrawal amount=${withdrawAmount}`);
+    let start = Date.now();
 
     await wallet.client.call(WalletApiOperation.WithdrawFakebank, {
-      amount: "TESTKUDOS:10",
+      amount: b1conf.currency + ":" + withdrawAmount,
       bank: b1conf.bank,
       exchange: b1conf.exchange,
     });
@@ -62,16 +86,24 @@ export async function runBench1(configJson: any): 
Promise<void> {
       stopWhenDone: true,
     });
 
-    await wallet.client.call(WalletApiOperation.CreateDepositGroup, {
-      amount: "TESTKUDOS:5",
-      depositPaytoUri: "payto://x-taler-bank/localhost/foo",
-    });
+    logger.info(`Finished withdrawal amount=${withdrawAmount} 
time=${Date.now() - start}`);
 
-    await wallet.runTaskLoop({
-      stopWhenDone: true,
-    });
+    for (let i = 0; i < numDeposits; i++) {
+
+      logger.trace(`Starting deposit amount=10`);
+      start = Date.now()
 
-    wallet.stop();
+      await wallet.client.call(WalletApiOperation.CreateDepositGroup, {
+        amount: b1conf.currency + ":10",
+        depositPaytoUri: b1conf.payto,
+      });
+
+      await wallet.runTaskLoop({
+        stopWhenDone: true,
+      });
+
+      logger.info(`Finished deposit amount=10 time=${Date.now() - start}`);
+    }
   }
 }
 
@@ -84,6 +116,11 @@ interface Bench1Config {
    */
   bank: string;
 
+  /**
+   * Payto url for deposits.
+   */
+  payto: string;
+
   /**
    * Base URL of the exchange.
    */
@@ -94,6 +131,16 @@ interface Bench1Config {
    * Defaults to 1.
    */
   iterations?: number;
+
+  currency: string;
+
+  deposits?: number;
+
+  /**
+   * How any iterations run until the wallet db gets purged
+   * Defaults to 20.
+   */
+  restartAfter?: number;
 }
 
 /**
@@ -102,6 +149,10 @@ interface Bench1Config {
 const codecForBench1Config = () =>
   buildCodecForObject<Bench1Config>()
     .property("bank", codecForString())
+    .property("payto", codecForString())
     .property("exchange", codecForString())
     .property("iterations", codecOptional(codecForNumber()))
+    .property("deposits", codecOptional(codecForNumber()))
+    .property("currency", codecForString())
+    .property("restartAfter", 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]