summaryrefslogtreecommitdiff
path: root/src/exchangedb/test_exchangedb_by_j.c
diff options
context:
space:
mode:
authorJoseph <Joseph.xu@efrei.net>2022-11-21 10:37:50 -0500
committerJoseph <Joseph.xu@efrei.net>2022-11-21 10:40:10 -0500
commiteba2a5d90c1dbc2e5121e404ac4154dc70d9cace (patch)
treea13f87e18c4d8283268806b76babfe29bbdd54de /src/exchangedb/test_exchangedb_by_j.c
parentdbfd4e252a1bdbc7e4c8c97fd4780a13369b872c (diff)
downloadexchange-eba2a5d90c1dbc2e5121e404ac4154dc70d9cace.tar.gz
exchange-eba2a5d90c1dbc2e5121e404ac4154dc70d9cace.tar.bz2
exchange-eba2a5d90c1dbc2e5121e404ac4154dc70d9cace.zip
new batch insertion code
Diffstat (limited to 'src/exchangedb/test_exchangedb_by_j.c')
-rw-r--r--src/exchangedb/test_exchangedb_by_j.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/exchangedb/test_exchangedb_by_j.c b/src/exchangedb/test_exchangedb_by_j.c
index 831416b4d..b2f6ddeb5 100644
--- a/src/exchangedb/test_exchangedb_by_j.c
+++ b/src/exchangedb/test_exchangedb_by_j.c
@@ -114,8 +114,10 @@ run (void *cls)
&value));
now = GNUNET_TIME_absolute_get ();
ts = GNUNET_TIME_timestamp_get ();
- plugin->start (plugin->cls,
- "test_by_j");
+ 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++)
{
@@ -127,13 +129,14 @@ run (void *cls)
reserves[k].wire_reference = k;
}
- FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
+ FAILIF (batch_size !=
plugin->batch_reserves_in_insert (plugin->cls,
reserves,
batch_size,
results));
plugin->commit (plugin->cls);
+ }
duration = GNUNET_TIME_absolute_get_duration (now);
fprintf (stdout,
"for a batchsize equal to %d it took %s\n",
@@ -141,6 +144,7 @@ run (void *cls)
GNUNET_STRINGS_relative_time_to_string (duration,
GNUNET_NO) );
}
+ result = 0;
drop:
GNUNET_break (GNUNET_OK ==
plugin->drop_tables (plugin->cls));