From 10c56bcea05df9ac5a7036850039900fbe435e00 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 20 Mar 2020 02:36:50 +0100 Subject: improving benchmarking logic, including more timings --- src/include/taler_error_codes.h | 49 +++++++++++++++++++++++++++++++++++++++++ src/include/taler_testing_lib.h | 43 ++++++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+) (limited to 'src/include') diff --git a/src/include/taler_error_codes.h b/src/include/taler_error_codes.h index 0969261a8..be62aa3f0 100644 --- a/src/include/taler_error_codes.h +++ b/src/include/taler_error_codes.h @@ -388,6 +388,13 @@ enum TALER_ErrorCode */ TALER_EC_WITHDRAW_RESERVE_BALANCE_CORRUPT = 1117, + /** + * The exchange responded with a reply that did not satsify the + * protocol. This error is not used in the protocol but created + * client-side. + */ + TALER_EC_WITHDRAW_REPLY_MALFORMED = 1118, + /** * The exchange failed to obtain the transaction history of the given * reserve from the database. This response is provided with HTTP @@ -401,6 +408,13 @@ enum TALER_ErrorCode */ TALER_EC_RESERVE_STATUS_UNKNOWN = 1151, + /** + * The exchange responded with a reply that did not satsify the + * protocol. This error is not used in the protocol but created + * client-side. + */ + TALER_EC_RESERVE_STATUS_REPLY_MALFORMED = 1152, + /** * The respective coin did not have sufficient residual value for the * /deposit operation (i.e. due to double spending). The "history" in @@ -752,12 +766,26 @@ enum TALER_ErrorCode */ TALER_EC_REFRESHES_INVALID_RCH = 1384, + /** + * The exchange responded with a reply that did not satsify the + * protocol. This error is not used in the protocol but created + * client-side. + */ + TALER_EC_REFRESH_REVEAL_REPLY_MALFORMED = 1385, + /** * The coin specified in the link request is unknown to the exchange. * This response is provided with HTTP status code MHD_HTTP_NOT_FOUND. */ TALER_EC_REFRESH_LINK_COIN_UNKNOWN = 1400, + /** + * The exchange responded with a reply that did not satsify the + * protocol. This error is not used in the protocol but created + * client-side. + */ + TALER_EC_REFRESH_LINK_REPLY_MALFORMED = 1401, + /** * The exchange knows literally nothing about the coin we were asked * to refund. But without a transaction history, we cannot issue a @@ -928,6 +956,13 @@ enum TALER_ErrorCode */ TALER_EC_TRACK_TRANSFER_WIRE_FEE_INCONSISTENT = 1704, + /** + * The exchange responded with a reply that did not satsify the + * protocol. This error is not used in the protocol but created + * client-side. + */ + TALER_EC_TRACK_TRANSFER_REPLY_MALFORMED = 1705, + /** * The exchange found internally inconsistent fee data when resolving * a transaction in the database. This response is provided with HTTP @@ -1039,6 +1074,13 @@ enum TALER_ErrorCode */ TALER_EC_RECOUP_DENOMINATION_VALIDITY_IN_FUTURE = 1860, + /** + * The exchange responded with a reply that did not satsify the + * protocol. This error is not used in the protocol but created + * client-side. + */ + TALER_EC_RECOUP_REPLY_MALFORMED = 1861, + /** * The "have" parameter was not a natural number. This reponse is * provied with an HTTP status code of MHD_HTTP_BAD_REQUEST. @@ -1732,6 +1774,13 @@ enum TALER_ErrorCode */ TALER_EC_AUDITOR_EXCHANGE_STORE_DB_ERROR = 3003, + /** + * The auditor (!) responded with a reply that did not satsify the + * protocol. This error is not used in the protocol but created + * client-side. + */ + TALER_EC_AUDITOR_EXCHANGES_REPLY_MALFORMED = 3004, + /** * The exchange failed to compute ECDH. This response is provided * with HTTP status code MHD_HTTP_INTERNAL_SERVER_ERROR. diff --git a/src/include/taler_testing_lib.h b/src/include/taler_testing_lib.h index 7e392f09b..9e32d72e6 100644 --- a/src/include/taler_testing_lib.h +++ b/src/include/taler_testing_lib.h @@ -495,6 +495,16 @@ struct TALER_TESTING_Command const char *trait, unsigned int index); + /** + * When did the execution of this command start? + */ + struct GNUNET_TIME_Absolute start_time; + + /** + * When did the execution of this command finish? + */ + struct GNUNET_TIME_Absolute finish_time; + }; @@ -1822,6 +1832,39 @@ TALER_TESTING_cmd_insert_deposit (const char *label, const char *amount_with_fee, const char *deposit_fee); + +/** + * Performance counter. + */ +struct TALER_TESTING_Timer +{ + /** + * For which type of commands. + */ + const char *prefix; + + /** + * Total time spend in all commands of this type. + */ + struct GNUNET_TIME_Relative total_duration; + + /** + * Number of commands summed up. + */ + unsigned int num_commands; +}; + + +/** + * Obtain performance data from the interpreter. + * + * @param timers what commands (by label) to obtain runtimes for + * @return the command + */ +struct TALER_TESTING_Command +TALER_TESTING_cmd_stat (struct TALER_TESTING_Timer *timers); + + /* *** Generic trait logic for implementing traits ********* */ /** -- cgit v1.2.3