diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-08-23 23:57:09 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-08-23 23:57:09 +0200 |
commit | 9c3d000e11d3b1fc6c6c205fe9e7ea26c11092c6 (patch) | |
tree | 7cf47fd2334487a0e4f2bfef73c8e09e165dc4cc /tests/storagebenchmark.cpp | |
parent | ae0255bf8eb913004082278af27d69047503ea71 (diff) | |
download | sink-9c3d000e11d3b1fc6c6c205fe9e7ea26c11092c6.tar.gz sink-9c3d000e11d3b1fc6c6c205fe9e7ea26c11092c6.zip |
Removed convenience API
Diffstat (limited to 'tests/storagebenchmark.cpp')
-rw-r--r-- | tests/storagebenchmark.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/storagebenchmark.cpp b/tests/storagebenchmark.cpp index f143c4d..e6ab049 100644 --- a/tests/storagebenchmark.cpp +++ b/tests/storagebenchmark.cpp | |||
@@ -98,7 +98,7 @@ private Q_SLOTS: | |||
98 | if (store) { | 98 | if (store) { |
99 | auto transaction = store->createTransaction(Akonadi2::Storage::ReadWrite); | 99 | auto transaction = store->createTransaction(Akonadi2::Storage::ReadWrite); |
100 | for (int i = 0; i < count; i++) { | 100 | for (int i = 0; i < count; i++) { |
101 | transaction.write(keyPrefix + QByteArray::number(i), event); | 101 | transaction.openDatabase().write(keyPrefix + QByteArray::number(i), event); |
102 | if ((i % 10000) == 0) { | 102 | if ((i % 10000) == 0) { |
103 | transaction.commit(); | 103 | transaction.commit(); |
104 | transaction = store->createTransaction(Akonadi2::Storage::ReadWrite); | 104 | transaction = store->createTransaction(Akonadi2::Storage::ReadWrite); |
@@ -149,7 +149,7 @@ private Q_SLOTS: | |||
149 | 149 | ||
150 | QBENCHMARK { | 150 | QBENCHMARK { |
151 | int hit = 0; | 151 | int hit = 0; |
152 | store->createTransaction(Akonadi2::Storage::ReadOnly).scan("", [&](const QByteArray &key, const QByteArray &value) -> bool { | 152 | store->createTransaction(Akonadi2::Storage::ReadOnly).openDatabase().scan("", [&](const QByteArray &key, const QByteArray &value) -> bool { |
153 | if (key == "key10000") { | 153 | if (key == "key10000") { |
154 | //qDebug() << "hit"; | 154 | //qDebug() << "hit"; |
155 | hit++; | 155 | hit++; |
@@ -166,7 +166,7 @@ private Q_SLOTS: | |||
166 | 166 | ||
167 | QBENCHMARK { | 167 | QBENCHMARK { |
168 | int hit = 0; | 168 | int hit = 0; |
169 | store->createTransaction(Akonadi2::Storage::ReadOnly).scan("key40000", [&](const QByteArray &key, const QByteArray &value) -> bool { | 169 | store->createTransaction(Akonadi2::Storage::ReadOnly).openDatabase().scan("key40000", [&](const QByteArray &key, const QByteArray &value) -> bool { |
170 | hit++; | 170 | hit++; |
171 | return true; | 171 | return true; |
172 | }); | 172 | }); |