diff options
author | Marco Boss <bossm8@bfh.ch> | 2022-05-12 16:15:54 +0200 |
---|---|---|
committer | Marco Boss <bossm8@bfh.ch> | 2022-05-12 16:15:54 +0200 |
commit | db320d3e8e0e4b6137bb24d429a8f96aa2730e87 (patch) | |
tree | 9734ca55abd5ee895ab9630604ea91052918f2f3 /src | |
parent | 7689c71cea7329b871bb2ccd93abd1f4ec3a67ab (diff) | |
download | exchange-db320d3e8e0e4b6137bb24d429a8f96aa2730e87.tar.xz |
add metrics for number of coins withdrawn in a batch request
Diffstat (limited to 'src')
-rw-r--r-- | src/exchange/taler-exchange-httpd_batch-withdraw.c | 5 | ||||
-rw-r--r-- | src/exchange/taler-exchange-httpd_metrics.c | 11 | ||||
-rw-r--r-- | 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 d272817c0..92a189c0c 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 66038f3a5..83b3d1f0a 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 1e08c6ac7..369b675c6 100644 --- a/src/exchange/taler-exchange-httpd_metrics.h +++ b/src/exchange/taler-exchange-httpd_metrics.h @@ -68,6 +68,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. */ |