diff options
author | Christian Mollekopf <mollekopf@kolabsystems.com> | 2017-10-12 16:29:07 +0200 |
---|---|---|
committer | Christian Mollekopf <mollekopf@kolabsystems.com> | 2017-10-12 16:29:37 +0200 |
commit | c43dfffabb5eeb5aeae2204669ec5fab19c99189 (patch) | |
tree | 9e6bd8203c0dec2711025b83da4f6d6393d1bf97 /tests | |
parent | 93e91facbab72d45310492c6f6d1c7b8ce010b3f (diff) | |
download | sink-c43dfffabb5eeb5aeae2204669ec5fab19c99189.tar.gz sink-c43dfffabb5eeb5aeae2204669ec5fab19c99189.zip |
hawd def for incremental vs nonincremental comparison
Diffstat (limited to 'tests')
-rw-r--r-- | tests/mailquerybenchmark.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/tests/mailquerybenchmark.cpp b/tests/mailquerybenchmark.cpp index f6d7130..700eb94 100644 --- a/tests/mailquerybenchmark.cpp +++ b/tests/mailquerybenchmark.cpp | |||
@@ -223,7 +223,8 @@ private slots: | |||
223 | } | 223 | } |
224 | QCOMPARE(added.size(), expectedSize); | 224 | QCOMPARE(added.size(), expectedSize); |
225 | 225 | ||
226 | std::cout << "Initial query took: " << time.elapsed() << std::endl; | 226 | auto initialQueryTime = time.elapsed(); |
227 | std::cout << "Initial query took: " << initialQueryTime << std::endl; | ||
227 | 228 | ||
228 | populateDatabase(count, 10, false, count); | 229 | populateDatabase(count, 10, false, count); |
229 | time.restart(); | 230 | time.restart(); |
@@ -232,13 +233,25 @@ private slots: | |||
232 | context.mResourceAccess->revisionChanged(1000 + i * 100); | 233 | context.mResourceAccess->revisionChanged(1000 + i * 100); |
233 | } | 234 | } |
234 | //We should have 200 items in total in the end. 2000 mails / 10 folders => 200 reduced mails | 235 | //We should have 200 items in total in the end. 2000 mails / 10 folders => 200 reduced mails |
235 | QTRY_COMPARE(added.count(), 200); | 236 | while (added.count() != 200) { |
237 | QTest::qWait(1); | ||
238 | } | ||
236 | //We get one modification per thread from the first 100 (1000 mails / 10 folders), everything else is optimized away because we ignore repeated updates to the same thread. | 239 | //We get one modification per thread from the first 100 (1000 mails / 10 folders), everything else is optimized away because we ignore repeated updates to the same thread. |
237 | QTRY_COMPARE(modified.count(), 100); | 240 | while (modified.count() != 100) { |
238 | std::cout << "Incremental query took " << time.elapsed() << std::endl; | 241 | QTest::qWait(1); |
242 | } | ||
243 | auto incrementalQueryTime = time.elapsed(); | ||
244 | std::cout << "Incremental query took " << incrementalQueryTime << std::endl; | ||
239 | std::cout << "added " << added.count() << std::endl; | 245 | std::cout << "added " << added.count() << std::endl; |
240 | std::cout << "modified " << modified.count() << std::endl; | 246 | std::cout << "modified " << modified.count() << std::endl; |
241 | std::cout << "removed " << removed.count() << std::endl; | 247 | std::cout << "removed " << removed.count() << std::endl; |
248 | |||
249 | HAWD::Dataset dataset("mail_query_incremental", mHawdState); | ||
250 | HAWD::Dataset::Row row = dataset.row(); | ||
251 | row.setValue("nonincremental", initialQueryTime); | ||
252 | row.setValue("incremental", incrementalQueryTime); | ||
253 | dataset.insertRow(row); | ||
254 | HAWD::Formatter::print(dataset); | ||
242 | } | 255 | } |
243 | }; | 256 | }; |
244 | 257 | ||