diff options
-rw-r--r-- | src/mintdb/perf_taler_mintdb.c | 53 | ||||
-rw-r--r-- | src/mintdb/perf_taler_mintdb_interpreter.c | 2 | ||||
-rw-r--r-- | src/mintdb/perf_taler_mintdb_interpreter.h | 42 | ||||
-rw-r--r-- | src/mintdb/perf_taler_mintdb_values.h | 32 |
4 files changed, 77 insertions, 52 deletions
diff --git a/src/mintdb/perf_taler_mintdb.c b/src/mintdb/perf_taler_mintdb.c index 0b1e48075..a39fdd811 100644 --- a/src/mintdb/perf_taler_mintdb.c +++ b/src/mintdb/perf_taler_mintdb.c @@ -33,30 +33,41 @@ main (int argc, char ** argv) struct GNUNET_CONFIGURATION_Handle *config; struct PERF_TALER_MINTDB_Cmd test[] = { - PERF_TALER_MINTDB_INIT_CMD_LOOP ("loop_db_init_deposit",10000), - PERF_TALER_MINTDB_INIT_CMD_START_TRANSACTION ("start_transaction_init"), - PERF_TALER_MINTDB_INIT_CMD_INSERT_DEPOSIT ("init_deposit_insert"), - PERF_TALER_MINTDB_INIT_CMD_COMMIT_TRANSACTION ("commit_transaction_init"), - PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY ("array_depo", - "loop_db_init_deposit", - "init_deposit_insert", - 100, - PERF_TALER_MINTDB_DEPOSIT), + PERF_TALER_MINTDB_INIT_CMD_LOOP ("loop_db_init_deposit", + PERF_TALER_MINTDB_NB_DEPOSIT_INIT), + PERF_TALER_MINTDB_INIT_CMD_START_TRANSACTION ("start_transaction_init"), + PERF_TALER_MINTDB_INIT_CMD_INSERT_DEPOSIT ("init_deposit_insert"), + PERF_TALER_MINTDB_INIT_CMD_COMMIT_TRANSACTION ("commit_transaction_init"), + PERF_TALER_MINTDB_INIT_CMD_DEBUG("INIT_LOOP"), + PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY ("array_depo", + "loop_db_init_deposit", + "init_deposit_insert", + PERF_TALER_MINTDB_NB_DEPOSIT_GET, + PERF_TALER_MINTDB_DEPOSIT), PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("endloop_init_deposit", "loop_db_init_deposit"), - PERF_TALER_MINTDB_INIT_CMD_DEBUG("Fin loop 1"), - PERF_TALER_MINTDB_INIT_CMD_LOOP ("loop_deposit_get",100), - PERF_TALER_MINTDB_INIT_CMD_START_TRANSACTION ("start_transaction_get"), - PERF_TALER_MINTDB_INIT_CMD_LOAD_ARRAY("load deposit", - "loop_deposit_get", - "array_depo"), - PERF_TALER_MINTDB_INIT_CMD_GET_DEPOSIT("get_deposit", - "load_deposit"), - PERF_TALER_MINTDB_INIT_CMD_COMMIT_TRANSACTION ("commit_transaction_init"), - PERF_TALER_MINTDB_INIT_CMD_END_LOOP("stop2", "loop_deposit_get"), - PERF_TALER_MINTDB_INIT_CMD_END("end") + PERF_TALER_MINTDB_INIT_CMD_DEBUG("INIT_END"), + // End of database initialization + PERF_TALER_MINTDB_INIT_CMD_GET_TIME ("deposit_get_start"), + PERF_TALER_MINTDB_INIT_CMD_LOOP ("loop_deposit_get", + PERF_TALER_MINTDB_NB_DEPOSIT_GET), + PERF_TALER_MINTDB_INIT_CMD_START_TRANSACTION ("start_transaction_get"), + PERF_TALER_MINTDB_INIT_CMD_LOAD_ARRAY ("load deposit", + "loop_deposit_get", + "array_depo"), + PERF_TALER_MINTDB_INIT_CMD_GET_DEPOSIT ("get_deposit", + "load_deposit"), + PERF_TALER_MINTDB_INIT_CMD_COMMIT_TRANSACTION ("commit_transaction_init"), + PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("stop2", "loop_deposit_get"), + PERF_TALER_MINTDB_INIT_CMD_GET_TIME ("deposit_get_end"), + PERF_TALER_MINTDB_INIT_CMD_GAUGER ("deposit_get_commit", + "deposit_get_start", + "deposit_get_end", + "time per deposit check", + PERF_TALER_MINTDB_NB_DEPOSIT_GET), + PERF_TALER_MINTDB_INIT_CMD_END("end"), }; - // Plugin init + // Plugin init config = GNUNET_CONFIGURATION_create(); GNUNET_CONFIGURATION_load(config, "./test-mint-db-postgres.conf"); GNUNET_assert (NULL != diff --git a/src/mintdb/perf_taler_mintdb_interpreter.c b/src/mintdb/perf_taler_mintdb_interpreter.c index d7d3a6d00..4d7a17cbb 100644 --- a/src/mintdb/perf_taler_mintdb_interpreter.c +++ b/src/mintdb/perf_taler_mintdb_interpreter.c @@ -407,7 +407,7 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state) GAUGER ("MINTDB", state->cmd[state->i].details.gauger.description, - elapsed_ms, + elapsed_ms / state->cmd[state->i].details.gauger.divide, "milliseconds"); } break; diff --git a/src/mintdb/perf_taler_mintdb_interpreter.h b/src/mintdb/perf_taler_mintdb_interpreter.h index 798660313..164379076 100644 --- a/src/mintdb/perf_taler_mintdb_interpreter.h +++ b/src/mintdb/perf_taler_mintdb_interpreter.h @@ -58,7 +58,7 @@ .exposed_type = PERF_TALER_MINTDB_NONE , \ .details.loop = { \ .max_iterations = _iter , \ - .curr_iteration = 0} \ + .curr_iteration = 0 } \ } /** @@ -86,15 +86,16 @@ * Commits the duration between @a _label_start and @a _label_stop * to Gauger with @a _description explaining */ -#define PERF_TALER_MINTDB_INIT_CMD_GAUGER(_label, _start_time, _stop_time, _description) \ +#define PERF_TALER_MINTDB_INIT_CMD_GAUGER(_label, _label_start, _label_stop, _description, _divide) \ { \ .command = PERF_TALER_MINTDB_CMD_GAUGER, \ .label = _label, \ .exposed_type = PERF_TALER_MINTDB_NONE, \ .details.gauger = { \ .label_start = _label_start, \ - .label_end = _label_end, \ - .description = _description \ + .label_stop = _label_stop, \ + .description = _description, \ + .divide = _divide, \ } \ } @@ -249,9 +250,7 @@ enum PERF_TALER_MINTDB_Type PERF_TALER_MINTDB_TIME, PERF_TALER_MINTDB_DEPOSIT, PERF_TALER_MINTDB_BLINDCOIN, - PERF_TALER_MINTDB_RESERVE_KEY, PERF_TALER_MINTDB_RESERVE, - PERF_TALER_MINTDB_DENOMINATION_KEY, PERF_TALER_MINTDB_DENOMINATION_INFO, PERF_TALER_MINTDB_COIN_INFO, }; @@ -266,7 +265,6 @@ union PERF_TALER_MINTDB_Data struct TALER_MINTDB_Deposit *deposit; struct TALER_MINTDB_CollectableBlindcoin *blindcoin; struct TALER_MINTDB_Reserve *reserve; - struct TALER_DenominationPublicKey *dpk; struct TALER_MINTDB_DenominationKeyIssueInformation *dki; struct TALER_CoinPublicInfo *cpi; }; @@ -334,8 +332,11 @@ enum PERF_TALER_MINTDB_CMD_Name // Insert informations about a denomination key in the database PERF_TALER_MINTDB_CMD_INSERT_DENOMINATION, - // polls the database for informations about a specific denomination key - PERF_TALER_MINTDB_CMD_GET_DENOMINATION + // Polls the database for informations about a specific denomination key + PERF_TALER_MINTDB_CMD_GET_DENOMINATION, + + // Refresh a coin + PERF_TALER_MINTDB_CMD_REFRESH_COIN, }; @@ -381,6 +382,12 @@ struct PERF_TALER_MINTDB_CMD_gauger_details * Description of the metric, used in GAUGER */ const char *description; + + /** + * Constant the result needs to be divided by + * to get the result per unit + */ + float divide; }; @@ -470,6 +477,19 @@ struct PERF_TALER_MINTDB_CMD_get_denomination_details const char *label_source; }; + +/** + * Extra data requiered for refreshing coins + */ +struct PERF_TALER_MINTDB_CMD_refresh_coin_details +{ + /** + * The label of the coin to refresh + */ + const char *label_source; +}; + + /** * Contains extra data required for any command */ @@ -483,6 +503,7 @@ union PERF_TALER_MINTDB_CMD_Details struct PERF_TALER_MINTDB_CMD_get_deposit_details get_deposit; struct PERF_TALER_MINTDB_CMD_get_reserve_details get_reserve; struct PERF_TALER_MINTDB_CMD_get_denomination_details get_denomination; + struct PERF_TALER_MINTDB_CMD_refresh_coin_details refresh; }; @@ -520,7 +541,7 @@ struct PERF_TALER_MINTDB_Cmd * GNUNET_YES if the exposed value hav been saved during last loop iteration * GNUNET_NO if it hasn't */ - int exposed_saved; + unsigned int exposed_saved; }; @@ -533,5 +554,4 @@ PERF_TALER_MINTDB_interpret( struct TALER_MINTDB_Plugin *db_plugin, struct PERF_TALER_MINTDB_Cmd cmd[]); - #endif diff --git a/src/mintdb/perf_taler_mintdb_values.h b/src/mintdb/perf_taler_mintdb_values.h index f180c8d7e..4b982b8bd 100644 --- a/src/mintdb/perf_taler_mintdb_values.h +++ b/src/mintdb/perf_taler_mintdb_values.h @@ -1,18 +1,18 @@ /* - This file is part of TALER - Copyright (C) 2014, 2015 Christian Grothoff (and other contributing authors) + This file is part of TALER + Copyright (C) 2014, 2015 Christian Grothoff (and other contributing authors) - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, If not, see <http://www.gnu.org/licenses/> -*/ + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, If not, see <http://www.gnu.org/licenses/> + */ /** * @file mintdb/perf_taler_mintdb_values.h * @brief Values for tweaking the performance analysis @@ -23,15 +23,9 @@ -#define NB_DEPOSIT_INIT 100000 -#define NB_DEPOSIT_GET 1000 -#define NB_DEPOSIT_MARGIN 10000 +#define PERF_TALER_MINTDB_NB_DEPOSIT_INIT 100 +#define PERF_TALER_MINTDB_NB_DEPOSIT_GET 10 -#define NB_BLINDCOIN_INIT 100000 - - -// Temporary macro to compile -#define GAUGER(a,b,c,d) #endif |