2015-06-09 17:35:33 +02:00
|
|
|
/*
|
|
|
|
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 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/>
|
|
|
|
*/
|
|
|
|
/**
|
|
|
|
* @file mintdb/perf_taler_mintdb.c
|
|
|
|
* @brief Mint database performance analysis
|
|
|
|
* @author Nicolas Fournier
|
|
|
|
*/
|
2015-06-09 13:03:37 +02:00
|
|
|
#include "perf_taler_mintdb_interpreter.h"
|
2015-06-10 14:59:14 +02:00
|
|
|
#include "perf_taler_mintdb_values.h"
|
2015-06-09 13:03:37 +02:00
|
|
|
|
2015-06-09 17:35:33 +02:00
|
|
|
/**
|
|
|
|
* Runs the performances tests for the mint database
|
|
|
|
*/
|
2015-06-09 13:03:37 +02:00
|
|
|
int
|
|
|
|
main(int argc, char ** argv)
|
|
|
|
{
|
2015-06-09 17:35:33 +02:00
|
|
|
|
2015-06-09 13:03:37 +02:00
|
|
|
struct PERF_TALER_MINTDB_CMD test[] =
|
|
|
|
{
|
|
|
|
INIT_CMD_LOOP("loop_db_init_deposit",100000),
|
|
|
|
INIT_CMD_START_TRANSACTION("start_transaction_init"),
|
|
|
|
INIT_CMD_INSERT_DEPOSIT("init_deposit_insert"),
|
|
|
|
INIT_CMD_COMMIT_TRANSACTION("commit_transaction_init"),
|
|
|
|
INIT_CMD_END_LOOP("endloop_init_deposit","loop_db_init_deposit"),
|
|
|
|
|
|
|
|
|
|
|
|
INIT_CMD_END("end")
|
|
|
|
};
|
|
|
|
|
2015-06-10 14:59:14 +02:00
|
|
|
struct GNUNET_CONFIGURATION_Handle config ;
|
|
|
|
GNUNET_CONFIGURATION_load(*config "./test-mint-db-postgres.conf");
|
2015-06-09 13:03:37 +02:00
|
|
|
|
2015-06-10 14:59:14 +02:00
|
|
|
struct TALER_MINTDB_Plugin *plugin = TALER_MINTDB_plugin_load(&config);
|
2015-06-09 13:03:37 +02:00
|
|
|
struct TALER_MINTDB_Session *session = plugin->get_session(plugin->cls, GNUNET_YES);
|
2015-06-10 14:59:14 +02:00
|
|
|
|
|
|
|
// creation of temporary tables
|
2015-06-09 13:03:37 +02:00
|
|
|
plugin->create_tables(plugin->cls, GNUNET_YES);
|
|
|
|
|
|
|
|
|
2015-06-10 14:59:14 +02:00
|
|
|
PERF_TALER_MINTDB_interpret(plugin, session, test);
|
2015-06-09 13:03:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
plugin->drop_temporary(plugin->cls, session);
|
|
|
|
|
|
|
|
// Free the session ??
|
|
|
|
|
|
|
|
TALER_MINTDB_plugin_unload(plugin);
|
|
|
|
return GNUNET_OK;
|
|
|
|
}
|