From b6476ac881cfd3bde41c88b94f6a7538acf76f9c Mon Sep 17 00:00:00 2001 From: Joseph Date: Wed, 23 Nov 2022 10:41:57 -0500 Subject: batch modifications --- src/exchangedb/test_exchangedb_by_j.c | 53 +++++++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-) (limited to 'src/exchangedb/test_exchangedb_by_j.c') diff --git a/src/exchangedb/test_exchangedb_by_j.c b/src/exchangedb/test_exchangedb_by_j.c index 43f47167..0f252a09 100644 --- a/src/exchangedb/test_exchangedb_by_j.c +++ b/src/exchangedb/test_exchangedb_by_j.c @@ -91,9 +91,22 @@ run (void *cls) result = 77; goto cleanup; } +<<<<<<< HEAD for (unsigned int i = 0; i< 7; i++) +======= + if (GNUNET_OK != + plugin->setup_partitions (plugin->cls, + num_partitions)) { - static unsigned int batches[] = {1, 1, 2, 4, 16, 64, 256}; + GNUNET_break (0); + result = 77; + goto cleanup; + } + + for (unsigned int i = 0; i< 8; i++) +>>>>>>> 26922c6d (batch modifications) + { + static unsigned int batches[] = {1, 1,0, 2, 4, 16, 64, 256}; const char *sndr = "payto://x-taler-bank/localhost:8080/1"; struct TALER_Amount value; unsigned int batch_size = batches[i]; @@ -101,6 +114,7 @@ run (void *cls) struct GNUNET_TIME_Timestamp ts; struct GNUNET_TIME_Relative duration; struct TALER_EXCHANGEDB_ReserveInInfo reserves[batch_size]; + /* struct TALER_EXCHANGEDB_ReserveInInfo reserves2[batch_size];*/ enum GNUNET_DB_QueryStatus results[batch_size]; GNUNET_assert (GNUNET_OK == TALER_string_to_amount (CURRENCY ":1.000010", @@ -109,9 +123,14 @@ run (void *cls) ts = GNUNET_TIME_timestamp_get (); for (unsigned int r = 0; r<10; r++) { +<<<<<<< HEAD plugin->start_read_committed (plugin->cls, "test_by_j"); +======= + plugin->start (plugin->cls, + "test_by_exchange_j"); +>>>>>>> 26922c6d (batch modifications) for (unsigned int k = 0; kcommit (plugin->cls); +======= + } + FAILIF (batch_size != + plugin->batch_reserves_in_insert (plugin->cls, + reserves, + batch_size, + results)); + /*plugin->commit (plugin->cls);*/ +>>>>>>> 26922c6d (batch modifications) } + /* + for (unsigned int s=0;s<10;s++) + { + for (unsigned int k = 0; kbatch_reserves_in_insert (plugin->cls, + reserves2, + batch_size, + results)); + }*/ + duration = GNUNET_TIME_absolute_get_duration (now); fprintf (stdout, "for a batchsize equal to %d it took %s\n", batch_size, GNUNET_STRINGS_relative_time_to_string (duration, GNUNET_NO) ); + } result = 0; drop: @@ -155,7 +204,6 @@ main (int argc, char *config_filename; char *testname; struct GNUNET_CONFIGURATION_Handle *cfg; - (void) argc; result = -1; if (NULL == (plugin_name = strrchr (argv[0], (int) '-'))) @@ -163,6 +211,7 @@ main (int argc, GNUNET_break (0); return -1; } + GNUNET_log_setup (argv[0], "WARNING", NULL); -- cgit v1.2.3