add metrics for number of coins withdrawn in a batch request

This commit is contained in:
Marco Boss 2022-05-12 16:15:54 +02:00
parent 7689c71cea
commit db320d3e8e
No known key found for this signature in database
GPG Key ID: 89A3EC33C625C3DF
3 changed files with 17 additions and 4 deletions

View File

@ -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,

View File

@ -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);

View File

@ -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.