gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: add metrics for number of coins


From: gnunet
Subject: [taler-exchange] branch master updated: add metrics for number of coins withdrawn in a batch request
Date: Thu, 12 May 2022 16:17:16 +0200

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

marco-boss pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new db320d3e add metrics for number of coins withdrawn in a batch request
db320d3e is described below

commit db320d3e8e0e4b6137bb24d429a8f96aa2730e87
Author: Marco Boss <bossm8@bfh.ch>
AuthorDate: Thu May 12 16:15:54 2022 +0200

    add metrics for number of coins withdrawn in a batch request
---
 src/exchange/taler-exchange-httpd_batch-withdraw.c |  5 +++--
 src/exchange/taler-exchange-httpd_metrics.c        | 11 +++++++++--
 src/exchange/taler-exchange-httpd_metrics.h        |  5 +++++
 3 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd_batch-withdraw.c 
b/src/exchange/taler-exchange-httpd_batch-withdraw.c
index d272817c..92a189c0 100644
--- a/src/exchange/taler-exchange-httpd_batch-withdraw.c
+++ b/src/exchange/taler-exchange-httpd_batch-withdraw.c
@@ -299,8 +299,8 @@ batch_withdraw_transaction (void *cls,
     bool nonce_reuse = true;
 
     nonce = (TALER_DENOMINATION_CS == bp->cipher)
-      ? &bp->details.cs_blinded_planchet.nonce
-      : NULL;
+            ? &bp->details.cs_blinded_planchet.nonce
+            : NULL;
     qs = TEH_plugin->do_batch_withdraw_insert (TEH_plugin->cls,
                                                nonce,
                                                &pc->collectable,
@@ -472,6 +472,7 @@ prepare_transaction (struct TEH_RequestContext *rc,
               "ev_sig",
               &pc->collectable.sig))));
     }
+    TEH_METRICS_batch_withdraw_num_coins += wc->planchets_length;
     return TALER_MHD_REPLY_JSON_PACK (
       rc->connection,
       MHD_HTTP_OK,
diff --git a/src/exchange/taler-exchange-httpd_metrics.c 
b/src/exchange/taler-exchange-httpd_metrics.c
index 66038f3a..83b3d1f0 100644
--- a/src/exchange/taler-exchange-httpd_metrics.c
+++ b/src/exchange/taler-exchange-httpd_metrics.c
@@ -31,6 +31,8 @@
 
 unsigned long long TEH_METRICS_num_requests[TEH_MT_REQUEST_COUNT];
 
+unsigned long long TEH_METRICS_batch_withdraw_num_coins;
+
 unsigned long long TEH_METRICS_num_conflict[TEH_MT_REQUEST_COUNT];
 
 unsigned long long TEH_METRICS_num_signatures[TEH_MT_SIGNATURE_COUNT];
@@ -78,7 +80,11 @@ TEH_handler_metrics (struct TEH_RequestContext *rc,
                    "# HELP taler_exchange_num_keyexchanges "
                    " number of key exchanges done by cipher\n"
                    "# TYPE taler_exchange_num_keyexchanges counter\n"
-                   "taler_exchange_num_keyexchanges{type=\"%s\"} %llu\n",
+                   "taler_exchange_num_keyexchanges{type=\"%s\"} %llu\n"
+                   "# HELP taler_exchange_batch_withdraw_num_coins "
+                   " number of coins withdrawn in a batch-withdraw request\n"
+                   "# TYPE taler_exchange_batch_withdraw_num_coins counter\n"
+                   "taler_exchange_batch_withdraw_num_coins{type=coins} 
%llu\n",
                    "other",
                    TEH_METRICS_num_conflict[TEH_MT_REQUEST_OTHER],
                    "deposit",
@@ -108,7 +114,8 @@ TEH_handler_metrics (struct TEH_RequestContext *rc,
                    "eddsa",
                    TEH_METRICS_num_verifications[TEH_MT_SIGNATURE_EDDSA],
                    "ecdh",
-                   TEH_METRICS_num_keyexchanges[TEH_MT_KEYX_ECDH]);
+                   TEH_METRICS_num_keyexchanges[TEH_MT_KEYX_ECDH],
+                   TEH_METRICS_batch_withdraw_num_coins);
   resp = MHD_create_response_from_buffer (strlen (reply),
                                           reply,
                                           MHD_RESPMEM_MUST_FREE);
diff --git a/src/exchange/taler-exchange-httpd_metrics.h 
b/src/exchange/taler-exchange-httpd_metrics.h
index 1e08c6ac..369b675c 100644
--- a/src/exchange/taler-exchange-httpd_metrics.h
+++ b/src/exchange/taler-exchange-httpd_metrics.h
@@ -67,6 +67,11 @@ enum TEH_MetricTypeKeyX
  */
 extern unsigned long long TEH_METRICS_num_requests[TEH_MT_REQUEST_COUNT];
 
+/**
+ * Number of coins withdrawn in a batch-withdraw request
+ */
+extern unsigned long long TEH_METRICS_batch_withdraw_num_coins;
+
 /**
  * Number of serialization errors encountered when
  * handling requests of the respective type.

-- 
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]