diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-05-22 13:06:17 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-05-22 13:06:17 +0200 |
commit | b1b943aa3eb1fd96a2b265aa02dd455da2e9f431 (patch) | |
tree | 7c00f9cdd42d0e49a47b1ca442743e9154175cb2 /src | |
parent | 737937291cceddd81e0dac676d3cb909250f628a (diff) |
-add metrics for idempotent (batch) withdraw
Diffstat (limited to 'src')
-rw-r--r-- | src/auditor/batch.conf | 9 | ||||
-rw-r--r-- | src/exchange/taler-exchange-httpd_batch-withdraw.c | 1 | ||||
-rw-r--r-- | src/exchange/taler-exchange-httpd_metrics.c | 17 | ||||
-rw-r--r-- | src/exchange/taler-exchange-httpd_metrics.h | 6 | ||||
-rw-r--r-- | src/exchange/taler-exchange-httpd_withdraw.c | 1 |
5 files changed, 28 insertions, 6 deletions
diff --git a/src/auditor/batch.conf b/src/auditor/batch.conf index afd1ae1fb..ad0912882 100644 --- a/src/auditor/batch.conf +++ b/src/auditor/batch.conf @@ -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/ - diff --git a/src/exchange/taler-exchange-httpd_batch-withdraw.c b/src/exchange/taler-exchange-httpd_batch-withdraw.c index e58548af7..f4276ef67 100644 --- a/src/exchange/taler-exchange-httpd_batch-withdraw.c +++ b/src/exchange/taler-exchange-httpd_batch-withdraw.c @@ -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; diff --git a/src/exchange/taler-exchange-httpd_metrics.c b/src/exchange/taler-exchange-httpd_metrics.c index d95080844..5b82282b0 100644 --- a/src/exchange/taler-exchange-httpd_metrics.c +++ b/src/exchange/taler-exchange-httpd_metrics.c @@ -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", diff --git a/src/exchange/taler-exchange-httpd_metrics.h b/src/exchange/taler-exchange-httpd_metrics.h index 369b675c6..25022d0da 100644 --- a/src/exchange/taler-exchange-httpd_metrics.h +++ b/src/exchange/taler-exchange-httpd_metrics.h @@ -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! */ }; /** diff --git a/src/exchange/taler-exchange-httpd_withdraw.c b/src/exchange/taler-exchange-httpd_withdraw.c index 7ad74f2a3..ca4ed9a71 100644 --- a/src/exchange/taler-exchange-httpd_withdraw.c +++ b/src/exchange/taler-exchange-httpd_withdraw.c @@ -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, |