add metrics for number of crypto operations

This commit is contained in:
Marco Boss 2022-03-14 20:06:07 +01:00
parent 687f0cab82
commit 7529939a0f
No known key found for this signature in database
GPG Key ID: 89A3EC33C625C3DF
31 changed files with 113 additions and 45 deletions

View File

@ -140,6 +140,7 @@ add_auditor_denom_sig (void *cls,
TALER_B2S (awc->auditor_pub)); TALER_B2S (awc->auditor_pub));
return GNUNET_DB_STATUS_HARD_ERROR; return GNUNET_DB_STATUS_HARD_ERROR;
} }
TEH_METRICS_num_verifications[TEH_MT_EDDSA]++;
if (GNUNET_OK != if (GNUNET_OK !=
TALER_auditor_denom_validity_verify ( TALER_auditor_denom_validity_verify (
auditor_url, auditor_url,
@ -213,7 +214,7 @@ TEH_handler_auditors (
return MHD_YES; /* failure */ return MHD_YES; /* failure */
ret = TEH_DB_run_transaction (connection, ret = TEH_DB_run_transaction (connection,
"add auditor denom sig", "add auditor denom sig",
TEH_MT_OTHER, TEH_MT_REQUEST_OTHER,
&res, &res,
&add_auditor_denom_sig, &add_auditor_denom_sig,
&awc); &awc);

View File

@ -81,7 +81,7 @@ TEH_make_coin_known (const struct TALER_CoinPublicInfo *coin,
enum GNUNET_GenericReturnValue enum GNUNET_GenericReturnValue
TEH_DB_run_transaction (struct MHD_Connection *connection, TEH_DB_run_transaction (struct MHD_Connection *connection,
const char *name, const char *name,
enum TEH_MetricType mt, enum TEH_MetricTypeRequest mt,
MHD_RESULT *mhd_ret, MHD_RESULT *mhd_ret,
TEH_DB_TransactionCallback cb, TEH_DB_TransactionCallback cb,
void *cb_cls) void *cb_cls)
@ -99,7 +99,7 @@ TEH_DB_run_transaction (struct MHD_Connection *connection,
NULL); NULL);
return GNUNET_SYSERR; return GNUNET_SYSERR;
} }
GNUNET_assert (mt < TEH_MT_COUNT); GNUNET_assert (mt < TEH_MT_REQUEST_COUNT);
TEH_METRICS_num_requests[mt]++; TEH_METRICS_num_requests[mt]++;
for (unsigned int retries = 0; for (unsigned int retries = 0;
retries < MAX_TRANSACTION_COMMIT_RETRIES; retries < MAX_TRANSACTION_COMMIT_RETRIES;

View File

@ -96,7 +96,7 @@ typedef enum GNUNET_DB_QueryStatus
enum GNUNET_GenericReturnValue enum GNUNET_GenericReturnValue
TEH_DB_run_transaction (struct MHD_Connection *connection, TEH_DB_run_transaction (struct MHD_Connection *connection,
const char *name, const char *name,
enum TEH_MetricType mt, enum TEH_MetricTypeRequest mt,
MHD_RESULT *mhd_ret, MHD_RESULT *mhd_ret,
TEH_DB_TransactionCallback cb, TEH_DB_TransactionCallback cb,
void *cb_cls); void *cb_cls);

View File

@ -382,6 +382,7 @@ TEH_handler_deposit (struct MHD_Connection *connection,
deposit.deposit_fee = dk->meta.fees.deposit; deposit.deposit_fee = dk->meta.fees.deposit;
/* check coin signature */ /* check coin signature */
TEH_METRICS_num_verifications[TEH_MT_CIPHER]++;
if (GNUNET_YES != if (GNUNET_YES !=
TALER_test_coin_valid (&deposit.coin, TALER_test_coin_valid (&deposit.coin,
&dk->denom_pub)) &dk->denom_pub))
@ -405,6 +406,7 @@ TEH_handler_deposit (struct MHD_Connection *connection,
NULL); NULL);
} }
TEH_METRICS_num_verifications[TEH_MT_EDDSA]++;
if (GNUNET_OK != if (GNUNET_OK !=
TALER_wallet_deposit_verify (&deposit.amount_with_fee, TALER_wallet_deposit_verify (&deposit.amount_with_fee,
&deposit.deposit_fee, &deposit.deposit_fee,
@ -472,7 +474,7 @@ TEH_handler_deposit (struct MHD_Connection *connection,
if (GNUNET_OK != if (GNUNET_OK !=
TEH_DB_run_transaction (connection, TEH_DB_run_transaction (connection,
"execute deposit", "execute deposit",
TEH_MT_DEPOSIT, TEH_MT_REQUEST_DEPOSIT,
&mhd_ret, &mhd_ret,
&deposit_transaction, &deposit_transaction,
&dc)) &dc))

View File

@ -247,7 +247,7 @@ handle_track_transaction_request (
if (GNUNET_OK != if (GNUNET_OK !=
TEH_DB_run_transaction (connection, TEH_DB_run_transaction (connection,
"handle deposits GET", "handle deposits GET",
TEH_MT_OTHER, TEH_MT_REQUEST_OTHER,
&mhd_ret, &mhd_ret,
&deposits_get_transaction, &deposits_get_transaction,
&ctx)) &ctx))
@ -344,6 +344,7 @@ TEH_handler_deposits_get (struct TEH_RequestContext *rc,
return MHD_NO; /* internal error */ return MHD_NO; /* internal error */
if (GNUNET_NO == res) if (GNUNET_NO == res)
return MHD_YES; /* parse error */ return MHD_YES; /* parse error */
TEH_METRICS_num_verifications[TEH_MT_EDDSA]++;
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MERCHANT_TRACK_TRANSACTION, GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MERCHANT_TRACK_TRANSACTION,
&tps, &tps,

View File

@ -2453,6 +2453,7 @@ TEH_keys_denomination_sign_withdraw (
switch (hd->denom_pub.cipher) switch (hd->denom_pub.cipher)
{ {
case TALER_DENOMINATION_RSA: case TALER_DENOMINATION_RSA:
TEH_METRICS_num_signatures[TEH_MT_CIPHER]++;
return TALER_CRYPTO_helper_rsa_sign ( return TALER_CRYPTO_helper_rsa_sign (
ksh->helpers->rsadh, ksh->helpers->rsadh,
&hd->h_details.h_rsa, &hd->h_details.h_rsa,
@ -2460,6 +2461,7 @@ TEH_keys_denomination_sign_withdraw (
bp->details.rsa_blinded_planchet.blinded_msg_size, bp->details.rsa_blinded_planchet.blinded_msg_size,
bs); bs);
case TALER_DENOMINATION_CS: case TALER_DENOMINATION_CS:
TEH_METRICS_num_signatures[TEH_MT_CIPHER]++;
return TALER_CRYPTO_helper_cs_sign_withdraw ( return TALER_CRYPTO_helper_cs_sign_withdraw (
ksh->helpers->csdh, ksh->helpers->csdh,
&hd->h_details.h_cs, &hd->h_details.h_cs,
@ -2492,6 +2494,7 @@ TEH_keys_denomination_sign_melt (
switch (hd->denom_pub.cipher) switch (hd->denom_pub.cipher)
{ {
case TALER_DENOMINATION_RSA: case TALER_DENOMINATION_RSA:
TEH_METRICS_num_signatures[TEH_MT_CIPHER]++;
return TALER_CRYPTO_helper_rsa_sign ( return TALER_CRYPTO_helper_rsa_sign (
ksh->helpers->rsadh, ksh->helpers->rsadh,
&hd->h_details.h_rsa, &hd->h_details.h_rsa,
@ -2499,6 +2502,7 @@ TEH_keys_denomination_sign_melt (
bp->details.rsa_blinded_planchet.blinded_msg_size, bp->details.rsa_blinded_planchet.blinded_msg_size,
bs); bs);
case TALER_DENOMINATION_CS: case TALER_DENOMINATION_CS:
TEH_METRICS_num_signatures[TEH_MT_CIPHER]++;
return TALER_CRYPTO_helper_cs_sign_melt ( return TALER_CRYPTO_helper_cs_sign_melt (
ksh->helpers->csdh, ksh->helpers->csdh,
&hd->h_details.h_cs, &hd->h_details.h_cs,
@ -2645,6 +2649,7 @@ TEH_keys_exchange_sign2_ (
{ {
enum TALER_ErrorCode ec; enum TALER_ErrorCode ec;
TEH_METRICS_num_signatures[TEH_MT_EDDSA]++;
ec = TALER_CRYPTO_helper_esign_sign_ (ksh->helpers->esh, ec = TALER_CRYPTO_helper_esign_sign_ (ksh->helpers->esh,
purpose, purpose,
pub, pub,

View File

@ -345,7 +345,7 @@ TEH_handler_kyc_check (
now = GNUNET_TIME_timestamp_get (); now = GNUNET_TIME_timestamp_get ();
ret = TEH_DB_run_transaction (rc->connection, ret = TEH_DB_run_transaction (rc->connection,
"kyc check", "kyc check",
TEH_MT_OTHER, TEH_MT_REQUEST_OTHER,
&res, &res,
&kyc_check, &kyc_check,
kyp); kyp);

View File

@ -675,7 +675,7 @@ TEH_handler_kyc_proof (
ret = TEH_DB_run_transaction (kpc->rc->connection, ret = TEH_DB_run_transaction (kpc->rc->connection,
"check proof kyc", "check proof kyc",
TEH_MT_OTHER, TEH_MT_REQUEST_OTHER,
&res, &res,
&persist_kyc_ok, &persist_kyc_ok,
kpc); kpc);

View File

@ -118,6 +118,7 @@ TEH_handler_kyc_wallet (
if (GNUNET_NO == ret) if (GNUNET_NO == ret)
return MHD_YES; /* failure */ return MHD_YES; /* failure */
TEH_METRICS_num_verifications[TEH_MT_EDDSA]++;
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify_ (TALER_SIGNATURE_WALLET_ACCOUNT_SETUP, GNUNET_CRYPTO_eddsa_verify_ (TALER_SIGNATURE_WALLET_ACCOUNT_SETUP,
&purpose, &purpose,
@ -140,7 +141,7 @@ TEH_handler_kyc_wallet (
0); 0);
ret = TEH_DB_run_transaction (rc->connection, ret = TEH_DB_run_transaction (rc->connection,
"check wallet kyc", "check wallet kyc",
TEH_MT_OTHER, TEH_MT_REQUEST_OTHER,
&res, &res,
&wallet_kyc_check, &wallet_kyc_check,
&krc); &krc);

View File

@ -203,7 +203,7 @@ TEH_handler_link (struct TEH_RequestContext *rc,
if (GNUNET_OK != if (GNUNET_OK !=
TEH_DB_run_transaction (rc->connection, TEH_DB_run_transaction (rc->connection,
"run link", "run link",
TEH_MT_OTHER, TEH_MT_REQUEST_OTHER,
&mhd_ret, &mhd_ret,
&link_transaction, &link_transaction,
&ctx)) &ctx))

View File

@ -189,7 +189,7 @@ TEH_handler_management_auditors (
ret = TEH_DB_run_transaction (connection, ret = TEH_DB_run_transaction (connection,
"add auditor", "add auditor",
TEH_MT_OTHER, TEH_MT_REQUEST_OTHER,
&res, &res,
&add_auditor, &add_auditor,
&aac); &aac);

View File

@ -178,7 +178,7 @@ TEH_handler_management_auditors_AP_disable (
ret = TEH_DB_run_transaction (connection, ret = TEH_DB_run_transaction (connection,
"del auditor", "del auditor",
TEH_MT_OTHER, TEH_MT_REQUEST_OTHER,
&res, &res,
&del_auditor, &del_auditor,
&dac); &dac);

View File

@ -56,6 +56,7 @@ TEH_handler_management_denominations_HDP_revoke (
if (GNUNET_NO == res) if (GNUNET_NO == res)
return MHD_YES; /* failure */ return MHD_YES; /* failure */
} }
TEH_METRICS_num_verifications[TEH_MT_EDDSA]++;
if (GNUNET_OK != if (GNUNET_OK !=
TALER_exchange_offline_denomination_revoke_verify ( TALER_exchange_offline_denomination_revoke_verify (
h_denom_pub, h_denom_pub,

View File

@ -278,7 +278,7 @@ TEH_handler_management_post_extensions (
res = TEH_DB_run_transaction (connection, res = TEH_DB_run_transaction (connection,
"set extensions", "set extensions",
TEH_MT_OTHER, TEH_MT_REQUEST_OTHER,
&ret, &ret,
&set_extensions, &set_extensions,
&sec); &sec);

View File

@ -221,6 +221,7 @@ TEH_handler_management_post_global_fees (
return MHD_YES; /* failure */ return MHD_YES; /* failure */
} }
TEH_METRICS_num_verifications[TEH_MT_EDDSA]++;
if (GNUNET_OK != if (GNUNET_OK !=
TALER_exchange_offline_global_fee_verify ( TALER_exchange_offline_global_fee_verify (
afc.start_time, afc.start_time,
@ -248,7 +249,7 @@ TEH_handler_management_post_global_fees (
res = TEH_DB_run_transaction (connection, res = TEH_DB_run_transaction (connection,
"add global fee", "add global fee",
TEH_MT_OTHER, TEH_MT_REQUEST_OTHER,
&ret, &ret,
&add_fee, &add_fee,
&afc); &afc);

View File

@ -179,6 +179,7 @@ add_keys (void *cls,
} }
/* check signature is valid */ /* check signature is valid */
TEH_METRICS_num_verifications[TEH_MT_EDDSA]++;
if (GNUNET_OK != if (GNUNET_OK !=
TALER_exchange_offline_denom_validity_verify ( TALER_exchange_offline_denom_validity_verify (
&d->h_denom_pub, &d->h_denom_pub,
@ -277,6 +278,7 @@ add_keys (void *cls,
} }
/* check signature is valid */ /* check signature is valid */
TEH_METRICS_num_verifications[TEH_MT_EDDSA]++;
if (GNUNET_OK != if (GNUNET_OK !=
TALER_exchange_offline_signkey_validity_verify ( TALER_exchange_offline_signkey_validity_verify (
&s->exchange_pub, &s->exchange_pub,
@ -459,7 +461,7 @@ TEH_handler_management_post_keys (
res = TEH_DB_run_transaction (connection, res = TEH_DB_run_transaction (connection,
"add keys", "add keys",
TEH_MT_OTHER, TEH_MT_REQUEST_OTHER,
&ret, &ret,
&add_keys, &add_keys,
&akc); &akc);

View File

@ -56,6 +56,7 @@ TEH_handler_management_signkeys_EP_revoke (
if (GNUNET_NO == res) if (GNUNET_NO == res)
return MHD_YES; /* failure */ return MHD_YES; /* failure */
} }
TEH_METRICS_num_verifications[TEH_MT_EDDSA]++;
if (GNUNET_OK != if (GNUNET_OK !=
TALER_exchange_offline_signkey_revoke_verify (exchange_pub, TALER_exchange_offline_signkey_revoke_verify (exchange_pub,
&TEH_master_public_key, &TEH_master_public_key,

View File

@ -179,7 +179,7 @@ TEH_handler_management_post_wire_disable (
res = TEH_DB_run_transaction (connection, res = TEH_DB_run_transaction (connection,
"del wire", "del wire",
TEH_MT_OTHER, TEH_MT_REQUEST_OTHER,
&ret, &ret,
&del_wire, &del_wire,
&awc); &awc);

View File

@ -165,6 +165,7 @@ TEH_handler_management_post_wire (
if (GNUNET_NO == res) if (GNUNET_NO == res)
return MHD_YES; /* failure */ return MHD_YES; /* failure */
} }
TEH_METRICS_num_verifications[TEH_MT_EDDSA]++;
if (GNUNET_OK != if (GNUNET_OK !=
TALER_exchange_offline_wire_add_verify (awc.payto_uri, TALER_exchange_offline_wire_add_verify (awc.payto_uri,
awc.validity_start, awc.validity_start,
@ -178,6 +179,7 @@ TEH_handler_management_post_wire (
TALER_EC_EXCHANGE_MANAGEMENT_WIRE_ADD_SIGNATURE_INVALID, TALER_EC_EXCHANGE_MANAGEMENT_WIRE_ADD_SIGNATURE_INVALID,
NULL); NULL);
} }
TEH_METRICS_num_verifications[TEH_MT_EDDSA]++;
if (GNUNET_OK != if (GNUNET_OK !=
TALER_exchange_wire_signature_check (awc.payto_uri, TALER_exchange_wire_signature_check (awc.payto_uri,
&TEH_master_public_key, &TEH_master_public_key,
@ -214,7 +216,7 @@ TEH_handler_management_post_wire (
res = TEH_DB_run_transaction (connection, res = TEH_DB_run_transaction (connection,
"add wire", "add wire",
TEH_MT_OTHER, TEH_MT_REQUEST_OTHER,
&ret, &ret,
&add_wire, &add_wire,
&awc); &awc);

View File

@ -188,6 +188,7 @@ TEH_handler_management_post_wire_fees (
return MHD_YES; /* failure */ return MHD_YES; /* failure */
} }
TEH_METRICS_num_verifications[TEH_MT_EDDSA]++;
if (GNUNET_OK != if (GNUNET_OK !=
TALER_exchange_offline_wire_fee_verify ( TALER_exchange_offline_wire_fee_verify (
afc.wire_method, afc.wire_method,
@ -212,7 +213,7 @@ TEH_handler_management_post_wire_fees (
res = TEH_DB_run_transaction (connection, res = TEH_DB_run_transaction (connection,
"add wire fee", "add wire fee",
TEH_MT_OTHER, TEH_MT_REQUEST_OTHER,
&ret, &ret,
&add_fee, &add_fee,
&afc); &afc);

View File

@ -265,7 +265,7 @@ database_melt (struct MHD_Connection *connection,
if (GNUNET_OK != if (GNUNET_OK !=
TEH_DB_run_transaction (connection, TEH_DB_run_transaction (connection,
"run melt", "run melt",
TEH_MT_MELT, TEH_MT_REQUEST_MELT,
&mhd_ret, &mhd_ret,
&melt_transaction, &melt_transaction,
rmc)) rmc))
@ -341,7 +341,7 @@ check_melt_valid (struct MHD_Connection *connection,
TALER_EC_EXCHANGE_MELT_FEES_EXCEED_CONTRIBUTION, TALER_EC_EXCHANGE_MELT_FEES_EXCEED_CONTRIBUTION,
NULL); NULL);
} }
TEH_METRICS_num_verifications[TEH_MT_CIPHER]++;
if (GNUNET_OK != if (GNUNET_OK !=
TALER_test_coin_valid (&rmc->refresh_session.coin, TALER_test_coin_valid (&rmc->refresh_session.coin,
&dk->denom_pub)) &dk->denom_pub))
@ -354,6 +354,7 @@ check_melt_valid (struct MHD_Connection *connection,
} }
/* verify signature of coin for melt operation */ /* verify signature of coin for melt operation */
TEH_METRICS_num_verifications[TEH_MT_EDDSA]++;
if (GNUNET_OK != if (GNUNET_OK !=
TALER_wallet_melt_verify (&rmc->refresh_session.amount_with_fee, TALER_wallet_melt_verify (&rmc->refresh_session.amount_with_fee,
&rmc->coin_refresh_fee, &rmc->coin_refresh_fee,

View File

@ -29,10 +29,13 @@
#include <jansson.h> #include <jansson.h>
unsigned long long TEH_METRICS_num_requests[TEH_MT_COUNT]; unsigned long long TEH_METRICS_num_requests[TEH_MT_REQUEST_COUNT];
unsigned long long TEH_METRICS_num_conflict[TEH_MT_COUNT]; unsigned long long TEH_METRICS_num_conflict[TEH_MT_REQUEST_COUNT];
unsigned long long TEH_METRICS_num_signatures[TEH_MT_CIPHER_COUNT];
unsigned long long TEH_METRICS_num_verifications[TEH_MT_CIPHER_COUNT];
MHD_RESULT MHD_RESULT
TEH_handler_metrics (struct TEH_RequestContext *rc, TEH_handler_metrics (struct TEH_RequestContext *rc,
@ -57,23 +60,41 @@ 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_received_requests{type=\"%s\"} %llu\n"
"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_received_requests{type=\"%s\"} %llu\n"
"# HELP taler_exchange_num_signatures "
" number of signatures created by cipher (rsa, cs) and eddsa\n"
"# TYPE taler_exchange_num_signatures counter\n"
"taler_exchange_num_signatures{type=\"%s\"} %llu\n"
"taler_exchange_num_signatures{type=\"%s\"} %llu\n"
"# HELP taler_exchange_num_signature_verifications "
" number of signatures verified by cipher (rsa, cs) and eddsa\n"
"# TYPE taler_exchange_num_signature_verifications counter\n"
"taler_exchange_num_signature_verifications{type=\"%s\"} %llu\n"
"taler_exchange_num_signature_verifications{type=\"%s\"} %llu\n",
"other", "other",
TEH_METRICS_num_conflict[TEH_MT_OTHER], TEH_METRICS_num_conflict[TEH_MT_REQUEST_OTHER],
"deposit", "deposit",
TEH_METRICS_num_conflict[TEH_MT_DEPOSIT], TEH_METRICS_num_conflict[TEH_MT_REQUEST_DEPOSIT],
"withdraw", "withdraw",
TEH_METRICS_num_conflict[TEH_MT_WITHDRAW], TEH_METRICS_num_conflict[TEH_MT_REQUEST_WITHDRAW],
"melt", "melt",
TEH_METRICS_num_conflict[TEH_MT_MELT], TEH_METRICS_num_conflict[TEH_MT_REQUEST_MELT],
"other", "other",
TEH_METRICS_num_requests[TEH_MT_OTHER], TEH_METRICS_num_requests[TEH_MT_REQUEST_OTHER],
"deposit", "deposit",
TEH_METRICS_num_requests[TEH_MT_DEPOSIT], TEH_METRICS_num_requests[TEH_MT_REQUEST_DEPOSIT],
"withdraw", "withdraw",
TEH_METRICS_num_requests[TEH_MT_WITHDRAW], TEH_METRICS_num_requests[TEH_MT_REQUEST_WITHDRAW],
"melt", "melt",
TEH_METRICS_num_requests[TEH_MT_MELT]); TEH_METRICS_num_requests[TEH_MT_REQUEST_MELT],
"cipher",
TEH_METRICS_num_signatures[TEH_MT_CIPHER],
"eddsa",
TEH_METRICS_num_signatures[TEH_MT_EDDSA],
"cipher",
TEH_METRICS_num_verifications[TEH_MT_CIPHER],
"eddsa",
TEH_METRICS_num_verifications[TEH_MT_EDDSA]);
resp = MHD_create_response_from_buffer (strlen (reply), resp = MHD_create_response_from_buffer (strlen (reply),
reply, reply,
MHD_RESPMEM_MUST_FREE); MHD_RESPMEM_MUST_FREE);

View File

@ -29,27 +29,45 @@
/** /**
* Request types for which we collect metrics. * Request types for which we collect metrics.
*/ */
enum TEH_MetricType enum TEH_MetricTypeRequest
{ {
TEH_MT_OTHER = 0, TEH_MT_REQUEST_OTHER = 0,
TEH_MT_DEPOSIT = 1, TEH_MT_REQUEST_DEPOSIT = 1,
TEH_MT_WITHDRAW = 2, TEH_MT_REQUEST_WITHDRAW = 2,
TEH_MT_MELT = 3, TEH_MT_REQUEST_MELT = 3,
TEH_MT_COUNT = 4 /* MUST BE LAST! */ TEH_MT_REQUEST_COUNT = 4 /* MUST BE LAST! */
}; };
/**
* Cipher types for which we collect metrics.
*/
enum TEH_MetricTypeRequestCipher
{
TEH_MT_CIPHER = 0,
TEH_MT_EDDSA = 2,
TEH_MT_CIPHER_COUNT = 3
};
/** /**
* Number of requests handled of the respective type. * Number of requests handled of the respective type.
*/ */
extern unsigned long long TEH_METRICS_num_requests[TEH_MT_COUNT]; extern unsigned long long TEH_METRICS_num_requests[TEH_MT_REQUEST_COUNT];
/** /**
* Number of serialization errors encountered when * Number of serialization errors encountered when
* handling requests of the respective type. * handling requests of the respective type.
*/ */
extern unsigned long long TEH_METRICS_num_conflict[TEH_MT_COUNT]; extern unsigned long long TEH_METRICS_num_conflict[TEH_MT_REQUEST_COUNT];
/**
* Number of signatures created by the respecitve cipher.
*/
extern unsigned long long TEH_METRICS_num_signatures[TEH_MT_CIPHER_COUNT];
/**
* Number of signatures verified by the respecitve cipher.
*/
extern unsigned long long TEH_METRICS_num_verifications[TEH_MT_CIPHER_COUNT];
/** /**
* Handle a "/metrics" request. * Handle a "/metrics" request.

View File

@ -217,6 +217,7 @@ verify_and_execute_recoup_refresh (
} }
/* check denomination signature */ /* check denomination signature */
TEH_METRICS_num_verifications[TEH_MT_CIPHER]++;
if (GNUNET_YES != if (GNUNET_YES !=
TALER_test_coin_valid (coin, TALER_test_coin_valid (coin,
&dk->denom_pub)) &dk->denom_pub))
@ -230,6 +231,7 @@ verify_and_execute_recoup_refresh (
} }
/* check recoup request signature */ /* check recoup request signature */
TEH_METRICS_num_verifications[TEH_MT_EDDSA]++;
if (GNUNET_OK != if (GNUNET_OK !=
TALER_wallet_recoup_refresh_verify (&coin->denom_pub_hash, TALER_wallet_recoup_refresh_verify (&coin->denom_pub_hash,
coin_bks, coin_bks,
@ -328,7 +330,7 @@ verify_and_execute_recoup_refresh (
if (GNUNET_OK != if (GNUNET_OK !=
TEH_DB_run_transaction (connection, TEH_DB_run_transaction (connection,
"run recoup-refresh", "run recoup-refresh",
TEH_MT_OTHER, TEH_MT_REQUEST_OTHER,
&mhd_ret, &mhd_ret,
&recoup_refresh_transaction, &recoup_refresh_transaction,
&pc)) &pc))

View File

@ -219,6 +219,7 @@ verify_and_execute_recoup (
} }
/* check denomination signature */ /* check denomination signature */
TEH_METRICS_num_verifications[TEH_MT_CIPHER]++;
if (GNUNET_YES != if (GNUNET_YES !=
TALER_test_coin_valid (coin, TALER_test_coin_valid (coin,
&dk->denom_pub)) &dk->denom_pub))
@ -232,6 +233,7 @@ verify_and_execute_recoup (
} }
/* check recoup request signature */ /* check recoup request signature */
TEH_METRICS_num_verifications[TEH_MT_EDDSA]++;
if (GNUNET_OK != if (GNUNET_OK !=
TALER_wallet_recoup_verify (&coin->denom_pub_hash, TALER_wallet_recoup_verify (&coin->denom_pub_hash,
coin_bks, coin_bks,
@ -341,7 +343,7 @@ verify_and_execute_recoup (
if (GNUNET_OK != if (GNUNET_OK !=
TEH_DB_run_transaction (connection, TEH_DB_run_transaction (connection,
"run recoup", "run recoup",
TEH_MT_OTHER, TEH_MT_REQUEST_OTHER,
&mhd_ret, &mhd_ret,
&recoup_transaction, &recoup_transaction,
&pc)) &pc))

View File

@ -684,6 +684,7 @@ clean_age:
return (GNUNET_NO == res) ? MHD_YES : MHD_NO; return (GNUNET_NO == res) ? MHD_YES : MHD_NO;
/* Check signature */ /* Check signature */
TEH_METRICS_num_verifications[TEH_MT_EDDSA]++;
if (GNUNET_OK != if (GNUNET_OK !=
TALER_wallet_link_verify ( TALER_wallet_link_verify (
&rrcs[i].h_denom_pub, &rrcs[i].h_denom_pub,

View File

@ -209,6 +209,7 @@ verify_and_execute_refund (struct MHD_Connection *connection,
.refund = refund .refund = refund
}; };
TEH_METRICS_num_verifications[TEH_MT_EDDSA]++;
if (GNUNET_OK != if (GNUNET_OK !=
TALER_merchant_refund_verify (&refund->coin.coin_pub, TALER_merchant_refund_verify (&refund->coin.coin_pub,
&refund->details.h_contract_terms, &refund->details.h_contract_terms,
@ -275,7 +276,7 @@ verify_and_execute_refund (struct MHD_Connection *connection,
if (GNUNET_OK != if (GNUNET_OK !=
TEH_DB_run_transaction (connection, TEH_DB_run_transaction (connection,
"run refund", "run refund",
TEH_MT_OTHER, TEH_MT_REQUEST_OTHER,
&mhd_ret, &mhd_ret,
&refund_transaction, &refund_transaction,
&rctx)) &rctx))

View File

@ -315,7 +315,7 @@ TEH_handler_reserves_get (struct TEH_RequestContext *rc,
if (GNUNET_OK != if (GNUNET_OK !=
TEH_DB_run_transaction (rc->connection, TEH_DB_run_transaction (rc->connection,
"get reserve history", "get reserve history",
TEH_MT_OTHER, TEH_MT_REQUEST_OTHER,
&mhd_ret, &mhd_ret,
&reserve_history_transaction, &reserve_history_transaction,
&rsc)) &rsc))

View File

@ -68,6 +68,7 @@ TEH_RESPONSE_compile_transaction_history (
&h_wire); &h_wire);
#if ENABLE_SANITY_CHECKS #if ENABLE_SANITY_CHECKS
/* internal sanity check before we hand out a bogus sig... */ /* internal sanity check before we hand out a bogus sig... */
TEH_METRICS_num_verifications[TEH_MT_EDDSA]++;
if (GNUNET_OK != if (GNUNET_OK !=
TALER_wallet_deposit_verify (&deposit->amount_with_fee, TALER_wallet_deposit_verify (&deposit->amount_with_fee,
&deposit->deposit_fee, &deposit->deposit_fee,
@ -132,6 +133,7 @@ TEH_RESPONSE_compile_transaction_history (
const struct TALER_AgeCommitmentHash *phac = NULL; const struct TALER_AgeCommitmentHash *phac = NULL;
#if ENABLE_SANITY_CHECKS #if ENABLE_SANITY_CHECKS
TEH_METRICS_num_verifications[TEH_MT_EDDSA]++;
if (GNUNET_OK != if (GNUNET_OK !=
TALER_wallet_melt_verify (&melt->amount_with_fee, TALER_wallet_melt_verify (&melt->amount_with_fee,
&melt->melt_fee, &melt->melt_fee,
@ -185,6 +187,7 @@ TEH_RESPONSE_compile_transaction_history (
struct TALER_Amount value; struct TALER_Amount value;
#if ENABLE_SANITY_CHECKS #if ENABLE_SANITY_CHECKS
TEH_METRICS_num_verifications[TEH_MT_EDDSA]++;
if (GNUNET_OK != if (GNUNET_OK !=
TALER_merchant_refund_verify (coin_pub, TALER_merchant_refund_verify (coin_pub,
&refund->h_contract_terms, &refund->h_contract_terms,

View File

@ -514,7 +514,7 @@ TEH_handler_transfers_get (struct TEH_RequestContext *rc,
if (GNUNET_OK != if (GNUNET_OK !=
TEH_DB_run_transaction (rc->connection, TEH_DB_run_transaction (rc->connection,
"run transfers GET", "run transfers GET",
TEH_MT_OTHER, TEH_MT_REQUEST_OTHER,
&mhd_ret, &mhd_ret,
&get_transfer_deposits, &get_transfer_deposits,
&ctx)) &ctx))

View File

@ -489,6 +489,7 @@ TEH_handler_withdraw (struct TEH_RequestContext *rc,
NULL); NULL);
} }
TEH_METRICS_num_verifications[TEH_MT_EDDSA]++;
if (GNUNET_OK != if (GNUNET_OK !=
TALER_wallet_withdraw_verify (&wc.collectable.denom_pub_hash, TALER_wallet_withdraw_verify (&wc.collectable.denom_pub_hash,
&wc.collectable.amount_with_fee, &wc.collectable.amount_with_fee,
@ -525,7 +526,7 @@ TEH_handler_withdraw (struct TEH_RequestContext *rc,
if (GNUNET_OK != if (GNUNET_OK !=
TEH_DB_run_transaction (rc->connection, TEH_DB_run_transaction (rc->connection,
"run withdraw", "run withdraw",
TEH_MT_WITHDRAW, TEH_MT_REQUEST_WITHDRAW,
&mhd_ret, &mhd_ret,
&withdraw_transaction, &withdraw_transaction,
&wc)) &wc))