diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-12-08 14:20:33 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-12-08 14:20:33 +0100 |
commit | f9cc76ad3c4d7a8c720e971a1a9cba1bb79fa974 (patch) | |
tree | 6746712e8b0d716410d14252c7fbb3d245c6e36a /src/exchangedb/test_exchangedb_by_j.c | |
parent | 329b7692ea4b09d9fb1399ad38af87b6e7486f38 (diff) | |
parent | db34b05a772504cce4fd13c6fafec28cd0d75907 (diff) |
Merge branch 'master' of git+ssh://git.taler.net/exchange
Diffstat (limited to 'src/exchangedb/test_exchangedb_by_j.c')
-rw-r--r-- | src/exchangedb/test_exchangedb_by_j.c | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/src/exchangedb/test_exchangedb_by_j.c b/src/exchangedb/test_exchangedb_by_j.c index 43f47167..834373b5 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; } + for (unsigned int i = 0; i< 7; i++) + + if (GNUNET_OK != + plugin->setup_partitions (plugin->cls, + num_partitions)) + { + GNUNET_break (0); + result = 77; + goto cleanup; + } + + for (unsigned int i = 0; i< 8; i++) + { - static unsigned int batches[] = {1, 1, 2, 4, 16, 64, 256}; + 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,10 +123,8 @@ run (void *cls) ts = GNUNET_TIME_timestamp_get (); for (unsigned int r = 0; r<10; r++) { - plugin->start_read_committed (plugin->cls, - "test_by_j"); - for (unsigned int k = 0; k<batch_size; k++) + for (unsigned int k = 0; k<batch_size; k++) { RND_BLK (&reserves[k].reserve_pub); reserves[k].balance = value; @@ -120,22 +132,21 @@ run (void *cls) reserves[k].sender_account_details = sndr; reserves[k].exchange_account_name = "name"; reserves[k].wire_reference = k; - } FAILIF (batch_size != - plugin->batch_reserves_in_insert (plugin->cls, - reserves, - batch_size, - results)); - - plugin->commit (plugin->cls); + plugin->batch_reserves_in_insert (plugin->cls, + reserves, + 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 +166,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 +173,7 @@ main (int argc, GNUNET_break (0); return -1; } + GNUNET_log_setup (argv[0], "WARNING", NULL); |