summaryrefslogtreecommitdiffstats
path: root/tests/storagebenchmark.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/storagebenchmark.cpp')
-rw-r--r--tests/storagebenchmark.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/storagebenchmark.cpp b/tests/storagebenchmark.cpp
index 33898d3..130753f 100644
--- a/tests/storagebenchmark.cpp
+++ b/tests/storagebenchmark.cpp
@@ -93,11 +93,16 @@ private Q_SLOTS:
93 93
94 time.start(); 94 time.start();
95 { 95 {
96 auto event = std::string(500, '1');//createEvent(); 96 auto event = createEvent();
97
98 if (store) store->startTransaction();
99 for (int i = 0; i < count; i++) { 97 for (int i = 0; i < count; i++) {
100 if (store) { 98 if (store) {
99 if (i % 10000 == 0) {
100 if (i > 0) {
101 store->commitTransaction();
102 }
103 store->startTransaction();
104 }
105
101 store->write(keyPrefix + std::to_string(i), event); 106 store->write(keyPrefix + std::to_string(i), event);
102 } else { 107 } else {
103 myfile << event; 108 myfile << event;