summaryrefslogtreecommitdiffstats
path: root/tests/mailquerybenchmark.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-05-11 11:58:15 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-05-11 11:58:15 +0200
commitbebbc07a1c517fd9020a83a5de3efcca5b0dccca (patch)
tree49b9873503a285adc985fe619153cd5d2b808d08 /tests/mailquerybenchmark.cpp
parent89c5405f200bed5f255fbf26602318b3f6426e9d (diff)
downloadsink-bebbc07a1c517fd9020a83a5de3efcca5b0dccca.tar.gz
sink-bebbc07a1c517fd9020a83a5de3efcca5b0dccca.zip
Fixed benchmark
Diffstat (limited to 'tests/mailquerybenchmark.cpp')
-rw-r--r--tests/mailquerybenchmark.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/mailquerybenchmark.cpp b/tests/mailquerybenchmark.cpp
index b15c8d6..00c156d 100644
--- a/tests/mailquerybenchmark.cpp
+++ b/tests/mailquerybenchmark.cpp
@@ -78,7 +78,7 @@ class MailQueryBenchmark : public QObject
78 entityStore.commitTransaction(); 78 entityStore.commitTransaction();
79 } 79 }
80 80
81 void testLoad(const Sink::Query &query, int count, int expectedSize) 81 void testLoad(const QByteArray &name, const Sink::Query &query, int count, int expectedSize)
82 { 82 {
83 const auto startingRss = getCurrentRSS(); 83 const auto startingRss = getCurrentRSS();
84 84
@@ -124,7 +124,7 @@ class MailQueryBenchmark : public QObject
124 std::cout << "Rss without db [kb]: " << rssWithoutDb / 1024 << std::endl; 124 std::cout << "Rss without db [kb]: " << rssWithoutDb / 1024 << std::endl;
125 std::cout << "Percentage error: " << percentageRssError << std::endl; 125 std::cout << "Percentage error: " << percentageRssError << std::endl;
126 126
127 HAWD::Dataset dataset("mail_query", mHawdState); 127 HAWD::Dataset dataset(QString{"mail_query"} + name, mHawdState);
128 HAWD::Dataset::Row row = dataset.row(); 128 HAWD::Dataset::Row row = dataset.row();
129 row.setValue("rows", list.size()); 129 row.setValue("rows", list.size());
130 row.setValue("queryResultPerMs", (qreal)list.size() / elapsed); 130 row.setValue("queryResultPerMs", (qreal)list.size() / elapsed);
@@ -159,7 +159,7 @@ private slots:
159 query.limit(1000); 159 query.limit(1000);
160 160
161 populateDatabase(50000); 161 populateDatabase(50000);
162 testLoad(query, 50000, query.limit()); 162 testLoad({}, query, 50000, query.limit());
163 } 163 }
164 164
165 void test50kThreadleader() 165 void test50kThreadleader()
@@ -176,7 +176,7 @@ private slots:
176 176
177 int count = 50000; 177 int count = 50000;
178 populateDatabase(count, mailsPerFolder); 178 populateDatabase(count, mailsPerFolder);
179 testLoad(query, count, query.limit()); 179 testLoad("_threadleader", query, count, query.limit());
180 } 180 }
181}; 181};
182 182