exchange/src/exchangedb/perf_taler_exchangedb.c

381 lines
20 KiB
C
Raw Normal View History

2015-06-09 17:35:33 +02:00
/*
This file is part of TALER
Copyright (C) 2014-2018 Taler Systems SA
2015-06-09 17:35:33 +02:00
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.
You should have received a copy of the GNU General Public License along with
2016-07-07 17:55:25 +02:00
TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
2015-06-09 17:35:33 +02:00
*/
/**
2016-03-01 15:35:04 +01:00
* @file exchangedb/perf_taler_exchangedb.c
* @brief Exchange database performance analysis
2015-06-09 17:35:33 +02:00
* @author Nicolas Fournier
2016-04-20 01:50:26 +02:00
* @author Christian Grothoff
2015-06-09 17:35:33 +02:00
*/
2015-06-12 11:14:32 +02:00
#include "platform.h"
2016-03-01 15:35:04 +01:00
#include "perf_taler_exchangedb_interpreter.h"
2015-07-01 18:14:28 +02:00
#define NB_DENOMINATION_INIT 15
#define NB_DENOMINATION_SAVE 15
2015-07-01 18:14:28 +02:00
2015-08-25 18:28:54 +02:00
#define SMALL 1000
#define BIG 10000
#define BIGGER 100000
2015-07-01 18:14:28 +02:00
#define NB_RESERVE_INIT BIGGER
#define NB_RESERVE_SAVE BIG
2015-07-01 18:14:28 +02:00
#define NB_DEPOSIT_INIT BIGGER
#define NB_DEPOSIT_SAVE BIG
#define NB_WITHDRAW_INIT BIGGER
#define NB_WITHDRAW_SAVE BIG
2015-07-01 18:14:28 +02:00
2015-08-10 18:12:27 +02:00
#define NB_REFRESH_INIT BIGGER
#define NB_REFRESH_SAVE BIG
2015-08-13 09:22:38 +02:00
#define NB_MELT_INIT BIG
#define NB_MELT_SAVE SMALL
2015-06-09 17:35:33 +02:00
/**
2016-03-01 15:35:04 +01:00
* Runs the performances tests for the exchange database
2015-06-11 15:55:46 +02:00
* and logs the results using Gauger
2015-06-09 17:35:33 +02:00
*/
int
2015-06-11 15:55:46 +02:00
main (int argc, char ** argv)
{
2015-07-01 18:14:28 +02:00
int ret;
2016-03-01 15:35:04 +01:00
struct PERF_TALER_EXCHANGEDB_Cmd benchmark[] =
2015-06-11 15:55:46 +02:00
{
2015-08-11 15:52:40 +02:00
/* Denomination used to create coins */
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_DEBUG ("Initializing database"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_LOOP ("01 - denomination loop",
NB_DENOMINATION_INIT),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_START_TRANSACTION (""),
PERF_TALER_EXCHANGEDB_INIT_CMD_CREATE_DENOMINATION ("01 - denomination"),
PERF_TALER_EXCHANGEDB_INIT_CMD_INSERT_DENOMINATION ("01 - insert",
2015-08-10 15:11:02 +02:00
"01 - denomination"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_COMMIT_TRANSACTION (""),
PERF_TALER_EXCHANGEDB_INIT_CMD_SAVE_ARRAY ("01 - save denomination",
2015-06-30 09:23:04 +02:00
"01 - denomination loop",
"01 - denomination",
NB_DENOMINATION_SAVE),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_END_LOOP ("01 - end",
2015-06-30 09:23:04 +02:00
"01 - denomination loop"),
2015-08-11 15:52:40 +02:00
/* End of initialization */
/* Reserve initialization */
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_LOOP ("02 - init reserve loop",
2017-11-27 23:42:17 +01:00
NB_RESERVE_INIT),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_CREATE_RESERVE ("02 - reserve"),
PERF_TALER_EXCHANGEDB_INIT_CMD_INSERT_RESERVE ("02 - insert",
2015-08-10 15:11:02 +02:00
"02 - reserve"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_SAVE_ARRAY ("02 - save reserve",
2015-06-30 09:23:04 +02:00
"02 - init reserve loop",
"02 - reserve",
NB_RESERVE_SAVE),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_END_LOOP ("02 - end",
2015-06-30 09:23:04 +02:00
"02 - init reserve loop"),
2015-08-11 15:52:40 +02:00
/* End reserve init */
/* Withdrawal initialization */
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_LOOP ("03 - init withdraw loop",
NB_WITHDRAW_INIT),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_START_TRANSACTION (""),
PERF_TALER_EXCHANGEDB_INIT_CMD_LOAD_ARRAY ("03 - denomination load",
2015-06-30 09:23:04 +02:00
"03 - init withdraw loop",
"01 - save denomination"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_LOAD_ARRAY ("03 - reserve load",
2015-06-30 09:23:04 +02:00
"03 - init withdraw loop",
"02 - save reserve"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_CREATE_WITHDRAW ("03 - withdraw",
2015-06-30 09:23:04 +02:00
"03 - denomination load",
"03 - reserve load"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_INSERT_WITHDRAW ("03 - insert",
2015-08-10 15:11:02 +02:00
"03 - withdraw"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_COMMIT_TRANSACTION (""),
PERF_TALER_EXCHANGEDB_INIT_CMD_SAVE_ARRAY ("03 - save coin",
2015-06-30 09:23:04 +02:00
"03 - init withdraw loop",
"03 - withdraw",
NB_WITHDRAW_SAVE),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_END_LOOP ("03 - end",
2015-06-30 09:23:04 +02:00
"03 - init withdraw loop"),
2015-08-11 15:52:40 +02:00
/*End of withdrawal initialization */
/*Deposit initialization */
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_LOOP ("04 - deposit init loop",
NB_DEPOSIT_INIT),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_START_TRANSACTION (""),
PERF_TALER_EXCHANGEDB_INIT_CMD_LOAD_ARRAY ("04 - coin load",
"04 - deposit init loop",
2015-07-16 17:21:25 +02:00
"03 - save coin"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_CREATE_DEPOSIT ("04 - deposit",
2015-07-16 17:21:25 +02:00
"04 - coin load"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_INSERT_DEPOSIT ("04 - insert",
2015-08-10 15:11:02 +02:00
"04 - deposit"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_COMMIT_TRANSACTION (""),
PERF_TALER_EXCHANGEDB_INIT_CMD_SAVE_ARRAY ("04 - deposit array",
2015-06-30 09:23:04 +02:00
"04 - deposit init loop",
"04 - deposit",
NB_DEPOSIT_SAVE),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_END_LOOP ("",
2015-06-30 09:23:04 +02:00
"04 - deposit init loop"),
2015-08-11 15:52:40 +02:00
/* End of deposit initialization */
/* Session initialization */
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_LOOP ("05 - refresh session init loop",
2015-08-10 18:12:27 +02:00
NB_REFRESH_INIT),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_START_TRANSACTION (""),
2017-11-27 23:42:17 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_LOAD_ARRAY ("05 - denomination load",
"05 - refresh session init loop",
"01 - save denomination"),
PERF_TALER_EXCHANGEDB_INIT_CMD_LOAD_ARRAY ("05 - reserve load",
"05 - refresh session init loop",
"02 - save reserve"),
PERF_TALER_EXCHANGEDB_INIT_CMD_CREATE_WITHDRAW ("05 - withdraw",
"05 - denomination load",
"05 - reserve load"),
PERF_TALER_EXCHANGEDB_INIT_CMD_CREATE_REFRESH_SESSION ("05 - refresh session",
"05 - withdraw"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_SAVE_ARRAY ("05 - session array",
2017-11-27 23:42:17 +01:00
"05 - refresh session init loop",
"05 - refresh session",
NB_RESERVE_SAVE),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_COMMIT_TRANSACTION (""),
PERF_TALER_EXCHANGEDB_INIT_CMD_END_LOOP ("05 - end",
2017-11-27 23:42:17 +01:00
"05 - refresh session init loop"),
2015-08-11 15:52:40 +02:00
/* End of refresh session initialization */
/* Refresh melt initialization */
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_LOOP ("06 - refresh melt init loop",
2015-08-13 09:22:38 +02:00
NB_MELT_INIT),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_START_TRANSACTION (""),
/* TODO: initialize using coins & sessions created localy
2015-08-17 10:56:56 +02:00
* in order to make sure the same coin are not melted twice*/
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_LOAD_ARRAY ("06 - session hash",
2015-08-11 15:52:40 +02:00
"06 - refresh melt init loop",
"05 - session array"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_LOAD_ARRAY ("06 - coin",
2015-08-11 15:52:40 +02:00
"06 - refresh melt init loop",
"03 - save coin"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_COMMIT_TRANSACTION (""),
PERF_TALER_EXCHANGEDB_INIT_CMD_END_LOOP ("06 - end",
2015-08-11 15:52:40 +02:00
"06 - refresh melt init loop"),
/* End of refresh melt initialization */
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_DEBUG ("End of initialization"),
2015-07-28 14:07:12 +02:00
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_DEBUG ("Start of performances measuring"),
PERF_TALER_EXCHANGEDB_INIT_CMD_GET_TIME ("21 - start"),
PERF_TALER_EXCHANGEDB_INIT_CMD_LOOP ("21 - reserve insert measure",
NB_RESERVE_SAVE),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_CREATE_RESERVE ("21 - reserve"),
PERF_TALER_EXCHANGEDB_INIT_CMD_INSERT_RESERVE ("21 - insert",
2015-08-13 09:22:38 +02:00
"21 - reserve"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_END_LOOP ("",
2015-08-13 09:22:38 +02:00
"21 - reserve insert measure"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_GET_TIME ("21 - stop"),
PERF_TALER_EXCHANGEDB_INIT_CMD_GAUGER ("21 - gauger",
2015-08-13 09:22:38 +02:00
"21 - start",
"21 - stop",
2015-07-27 15:56:01 +02:00
"POSTGRES",
"Number of reserve inserted per second",
"item/sec",
NB_RESERVE_SAVE),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_DEBUG ("End of reserve insertion"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_GET_TIME ("22 - start"),
PERF_TALER_EXCHANGEDB_INIT_CMD_LOOP ("22 - reserve load measure",
NB_RESERVE_SAVE),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_LOAD_ARRAY ("22 - reserve",
2015-08-13 09:22:38 +02:00
"22 - reserve load measure",
"02 - save reserve"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_GET_RESERVE ("22 - get",
2015-08-13 09:22:38 +02:00
"22 - reserve"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_END_LOOP ("",
2015-08-13 09:22:38 +02:00
"22 - reserve load measure"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_GET_TIME ("22 - stop"),
PERF_TALER_EXCHANGEDB_INIT_CMD_GAUGER ("",
2015-08-13 09:22:38 +02:00
"22 - start",
"22 - stop",
2015-07-27 15:56:01 +02:00
"POSTGRES",
"Number of reserve loaded per second",
"item/sec",
NB_RESERVE_SAVE),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_DEBUG ("End of reserve retreival"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_GET_TIME ("23 - start"),
PERF_TALER_EXCHANGEDB_INIT_CMD_LOOP ("23 - reserve history measure",
NB_RESERVE_SAVE),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_LOAD_ARRAY ("23 - reserve",
2015-08-13 09:22:38 +02:00
"23 - reserve history measure",
"02 - save reserve"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_GET_RESERVE_HISTORY ("",
2015-08-13 09:22:38 +02:00
"23 - reserve"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_END_LOOP ("",
2015-08-13 09:22:38 +02:00
"23 - reserve history measure"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_GET_TIME ("23 - stop"),
PERF_TALER_EXCHANGEDB_INIT_CMD_GAUGER ("",
2015-08-13 09:22:38 +02:00
"23 - start",
"23 - stop",
2015-07-27 15:56:01 +02:00
"POSTGRES",
"Number of reserve history loaded per second",
"item/sec",
NB_RESERVE_SAVE),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_DEBUG ("End of reserve history access"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_GET_TIME ("24 - start"),
PERF_TALER_EXCHANGEDB_INIT_CMD_LOOP ("24 - withdraw insert measure",
NB_WITHDRAW_SAVE),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_LOAD_ARRAY ("24 - reserve",
2015-08-13 09:22:38 +02:00
"24 - withdraw insert measure",
"02 - save reserve"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_LOAD_ARRAY ("24 - denomination",
2015-08-13 09:22:38 +02:00
"24 - withdraw insert measure",
"01 - save denomination"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_CREATE_WITHDRAW ("24 - withdraw",
2015-08-13 09:22:38 +02:00
"24 - denomination",
"24 - reserve"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_INSERT_WITHDRAW ("24 - insert",
2015-08-13 09:22:38 +02:00
"24 - withdraw"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_END_LOOP ("",
2015-08-13 09:22:38 +02:00
"24 - withdraw insert measure"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_GET_TIME ("24 - stop"),
PERF_TALER_EXCHANGEDB_INIT_CMD_GAUGER ("",
2015-08-13 09:22:38 +02:00
"24 - start",
"24 - stop",
2015-07-27 15:56:01 +02:00
"POSTGRES",
"Number of withdraw insert per second",
"item/sec",
NB_WITHDRAW_SAVE),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_DEBUG ("End of withdraw insertion"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_GET_TIME ("25 - start"),
PERF_TALER_EXCHANGEDB_INIT_CMD_LOOP ("25 - withdraw insert measure",
NB_RESERVE_SAVE),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_LOAD_ARRAY ("25 - coin",
2015-08-13 09:22:38 +02:00
"25 - withdraw insert measure",
2015-07-31 17:17:29 +02:00
"03 - save coin"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_GET_WITHDRAW ("",
2015-08-13 09:22:38 +02:00
"25 - coin"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_END_LOOP ("",
2015-08-13 09:22:38 +02:00
"25 - withdraw insert measure"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_GET_TIME ("25 - stop"),
PERF_TALER_EXCHANGEDB_INIT_CMD_GAUGER ("",
2015-08-13 09:22:38 +02:00
"25 - start",
"25 - stop",
2015-07-27 15:56:01 +02:00
"POSTGRES",
2015-07-20 14:07:02 +02:00
"Number of withdraw loaded per second",
"item/sec",
NB_RESERVE_SAVE),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_DEBUG ("End of withdraw loading"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_GET_TIME ("26 - start"),
PERF_TALER_EXCHANGEDB_INIT_CMD_LOOP ("26 - get coin transaction",
2015-07-27 15:56:01 +02:00
NB_WITHDRAW_SAVE),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_LOAD_ARRAY ("26 - coin",
2015-08-13 09:22:38 +02:00
"26 - get coin transaction",
2015-07-27 15:56:01 +02:00
"03 - save coin"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_GET_COIN_TRANSACTION("",
2015-08-13 09:22:38 +02:00
"26 - coin"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_END_LOOP ("",
2015-08-13 09:22:38 +02:00
"26 - get coin transaction"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_GET_TIME ("26 - end"),
PERF_TALER_EXCHANGEDB_INIT_CMD_GAUGER ("",
2015-08-13 09:22:38 +02:00
"26 - start",
"26 - end",
2015-07-27 15:56:01 +02:00
"POSTGRES",
"Number of coin transaction history loaded per second",
"item/sec",
NB_WITHDRAW_SAVE),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_DEBUG ("End of transaction loading"),
2015-07-28 14:07:12 +02:00
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_GET_TIME ("27 - start"),
PERF_TALER_EXCHANGEDB_INIT_CMD_LOOP ("27 - /reserve/withdraw",
2015-07-27 15:56:01 +02:00
NB_WITHDRAW_SAVE),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_LOAD_ARRAY ("27 - reserve",
2015-09-19 22:08:49 +02:00
"27 - /reserve/withdraw",
2015-07-27 16:38:05 +02:00
"02 - save reserve"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_LOAD_ARRAY ("27 - dki",
2015-09-19 22:08:49 +02:00
"27 - /reserve/withdraw",
2015-07-27 16:38:05 +02:00
"01 - save denomination"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_WITHDRAW_SIGN ("",
2015-08-13 09:22:38 +02:00
"27 - dki",
"27 - reserve"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_END_LOOP ("",
2015-09-19 22:08:49 +02:00
"27 - /reserve/withdraw"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_GET_TIME ("27 - end"),
PERF_TALER_EXCHANGEDB_INIT_CMD_GAUGER ("",
2015-08-13 09:22:38 +02:00
"27 - start",
"27 - end",
2015-07-27 15:56:01 +02:00
"POSTGRES",
2015-09-19 22:08:49 +02:00
"Number of /reserve/withdraw per second",
2015-07-27 15:56:01 +02:00
"item/sec",
NB_WITHDRAW_SAVE),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_DEBUG ("End of /reserve/withdraw"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_GET_TIME ("28 - start"),
PERF_TALER_EXCHANGEDB_INIT_CMD_LOOP ("28 - /deposit",
2015-08-03 10:26:52 +02:00
NB_DEPOSIT_SAVE),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_LOAD_ARRAY ("28 - coin",
2015-08-13 09:22:38 +02:00
"28 - /deposit",
2015-08-03 10:26:52 +02:00
"03 - save coin"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_DEPOSIT ("28 - deposit",
2015-08-13 09:22:38 +02:00
"28 - coin"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_END_LOOP ("",
2015-08-13 09:22:38 +02:00
"28 - /deposit"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_GET_TIME ("28 - stop"),
PERF_TALER_EXCHANGEDB_INIT_CMD_GAUGER ("",
2015-08-13 09:22:38 +02:00
"28 - start",
"28 - stop",
2015-08-03 10:26:52 +02:00
"POSTGRES",
"Number of /deposit per second",
"item/sec",
NB_DEPOSIT_SAVE),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_GET_TIME ("29 - start"),
PERF_TALER_EXCHANGEDB_INIT_CMD_LOOP ("29 - insert refresh session",
2017-11-27 23:42:17 +01:00
NB_REFRESH_SAVE),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_START_TRANSACTION (""),
2017-11-27 23:42:17 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_LOAD_ARRAY ("29 - denomination load",
"29 - insert refresh session",
"01 - save denomination"),
PERF_TALER_EXCHANGEDB_INIT_CMD_LOAD_ARRAY ("29 - reserve load",
"29 - insert refresh session",
"02 - save reserve"),
PERF_TALER_EXCHANGEDB_INIT_CMD_CREATE_WITHDRAW ("29 - withdraw",
"29 - denomination load",
"29 - reserve load"),
PERF_TALER_EXCHANGEDB_INIT_CMD_CREATE_REFRESH_SESSION ("29 - refresh session",
"29 - withdraw"),
PERF_TALER_EXCHANGEDB_INIT_CMD_SAVE_ARRAY ("29 - session array",
"29 - insert refresh session",
"29 - refresh session",
NB_RESERVE_SAVE),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_COMMIT_TRANSACTION (""),
PERF_TALER_EXCHANGEDB_INIT_CMD_END_LOOP ("",
2015-08-13 09:22:38 +02:00
"29 - insert refresh session"),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_GET_TIME ("29 - stop"),
PERF_TALER_EXCHANGEDB_INIT_CMD_GAUGER ("",
2015-08-13 09:22:38 +02:00
"29 - start",
"29 - stop",
"POSTGRES",
"Number of refresh session inserted per second",
"item/sec",
NB_REFRESH_SAVE),
2016-03-01 15:35:04 +01:00
PERF_TALER_EXCHANGEDB_INIT_CMD_END (""),
2015-06-11 15:55:46 +02:00
};
2015-07-28 14:07:12 +02:00
2016-03-01 15:35:04 +01:00
ret = PERF_TALER_EXCHANGEDB_run_benchmark (
"perf-taler-exchangedb",
"./test-exchange-db-postgres.conf",
(struct PERF_TALER_EXCHANGEDB_Cmd []) {PERF_TALER_EXCHANGEDB_INIT_CMD_END("")},
benchmark);
2015-07-06 11:11:43 +02:00
if (GNUNET_SYSERR == ret)
return 1;
return 0;
}