-add metrics for idempotent (batch) withdraw

This commit is contained in:
Christian Grothoff 2022-05-22 13:06:17 +02:00
parent 737937291c
commit b1b943aa3e
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
6 changed files with 29 additions and 7 deletions

@ -1 +1 @@
Subproject commit 99d8d9e0336bacebab5af4ae00c3f685ffd90f60
Subproject commit fa6373d8e2432cd63da881e05f4100240e688cdf

View File

@ -113,7 +113,7 @@ currency = TESTKUDOS
[merchant-exchange-default]
CURRENCY = TESTKUDOS
EXCHANGE_BASE_URL = http://localhost:8081/
MASTER_KEY = X2759N3GMFX9N4PAS10ZGXJ3XHF69PJ9K2P9QAQPJMKEH413MW2G
MASTER_KEY = 2XPQZ7B7EERWT7GR0MF30HPFG4TA1J0CWCQ3XBD48PA4K7GVDBK0
[merchant-account-merchant]
ACTIVE_default = YES
@ -157,14 +157,14 @@ CONFIG = postgres:///batch
[exchange]
LOOKAHEAD_SIGN = 32 weeks 1 day
SIGNKEY_DURATION = 4 weeks
MASTER_PUBLIC_KEY = X2759N3GMFX9N4PAS10ZGXJ3XHF69PJ9K2P9QAQPJMKEH413MW2G
MASTER_PUBLIC_KEY = 2XPQZ7B7EERWT7GR0MF30HPFG4TA1J0CWCQ3XBD48PA4K7GVDBK0
SIGNKEY_LEGAL_DURATION = 4 weeks
UNIXPATH = ${TALER_RUNTIME_DIR}/exchange.http
[bank]
SERVE = http
ALLOW_REGISTRATIONS = YES
SUGGESTED_EXCHANGE_PAYTO = payto://x-taler-bank/localhost/2
SUGGESTED_EXCHANGE_PAYTO = payto://x-taler-bank/localhost:8082/2
SUGGESTED_EXCHANGE = http://localhost:8081/
HTTP_PORT = 8082
MAX_DEBT_BANK = TESTKUDOS:100000.0
@ -175,7 +175,7 @@ DATABASE = postgres:///batch
CONFIG = postgres:///batch
[auditor]
PUBLIC_KEY = EK8NVJACS6PCXMZ0CY33K753MGRX5BTXSTRWPGJXWFSBNJ1PNZ8G
PUBLIC_KEY = JG9QFRG7R7BH9701420BD6M38NZW21MV9AR3QHYJEAHZ4S26B3HG
TINY_AMOUNT = TESTKUDOS:0.01
BASE_URL = http://localhost:8083/
@ -184,4 +184,3 @@ TALER_CACHE_HOME = $TALER_HOME/.cache/taler/
TALER_CONFIG_HOME = $TALER_HOME/.config/taler/
TALER_DATA_HOME = $TALER_HOME/.local/share/taler/
TALER_HOME = ${PWD}/generate_auditordb_home/

View File

@ -352,6 +352,7 @@ check_request_idempotent (const struct TEH_RequestContext *rc,
return false;
}
/* generate idempotent reply */
TEH_METRICS_num_requests[TEH_MT_REQUEST_IDEMPOTENT_BATCH_WITHDRAW]++;
*mret = generate_reply_success (rc,
wc);
return true;

View File

@ -65,6 +65,12 @@ TEH_handler_metrics (struct TEH_RequestContext *rc,
"taler_exchange_received_requests{type=\"%s\"} %llu\n"
"taler_exchange_received_requests{type=\"%s\"} %llu\n"
"taler_exchange_received_requests{type=\"%s\"} %llu\n"
"taler_exchange_idempotent_requests{type=\"%s\"} %llu\n"
#if NOT_YET_IMPLEMENTED
"taler_exchange_idempotent_requests{type=\"%s\"} %llu\n"
"taler_exchange_idempotent_requests{type=\"%s\"} %llu\n"
#endif
"taler_exchange_idempotent_requests{type=\"%s\"} %llu\n"
"# HELP taler_exchange_num_signatures "
" number of signatures created by cipher\n"
"# TYPE taler_exchange_num_signatures counter\n"
@ -101,6 +107,17 @@ TEH_handler_metrics (struct TEH_RequestContext *rc,
TEH_METRICS_num_requests[TEH_MT_REQUEST_WITHDRAW],
"melt",
TEH_METRICS_num_requests[TEH_MT_REQUEST_MELT],
"withdraw",
TEH_METRICS_num_requests[TEH_MT_REQUEST_IDEMPOTENT_WITHDRAW],
#if NOT_YET_IMPLEMENTED
"deposit",
TEH_METRICS_num_requests[TEH_MT_REQUEST_IDEMPOTENT_DEPOSIT],
"melt",
TEH_METRICS_num_requests[TEH_MT_REQUEST_IDEMPOTENT_MELT],
#endif
"batch-withdraw",
TEH_METRICS_num_requests[
TEH_MT_REQUEST_IDEMPOTENT_BATCH_WITHDRAW],
"rsa",
TEH_METRICS_num_signatures[TEH_MT_SIGNATURE_RSA],
"cs",

View File

@ -39,7 +39,11 @@ enum TEH_MetricTypeRequest
TEH_MT_REQUEST_PURSE_MERGE = 5,
TEH_MT_REQUEST_RESERVE_PURSE = 6,
TEH_MT_REQUEST_PURSE_DEPOSIT = 7,
TEH_MT_REQUEST_COUNT = 8 /* MUST BE LAST! */
TEH_MT_REQUEST_IDEMPOTENT_DEPOSIT = 8,
TEH_MT_REQUEST_IDEMPOTENT_WITHDRAW = 9,
TEH_MT_REQUEST_IDEMPOTENT_MELT = 10,
TEH_MT_REQUEST_IDEMPOTENT_BATCH_WITHDRAW = 11,
TEH_MT_REQUEST_COUNT = 12 /* MUST BE LAST! */
};
/**

View File

@ -232,6 +232,7 @@ check_request_idempotent (struct TEH_RequestContext *rc,
if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs)
return false;
/* generate idempotent reply */
TEH_METRICS_num_requests[TEH_MT_REQUEST_IDEMPOTENT_WITHDRAW]++;
*mret = TALER_MHD_REPLY_JSON_PACK (
rc->connection,
MHD_HTTP_OK,