summaryrefslogtreecommitdiffstats
path: root/tests/mailquerybenchmark.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-02-16 18:01:04 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-02-16 18:05:49 +0100
commit101176cc504bbecf0eb36e04f250796030a10152 (patch)
treeba5248be0459cbcc8f19bbe5df4c8f4b71cfbfb4 /tests/mailquerybenchmark.cpp
parent45a5bf6910db54f358409e7c407b8081cdd711a4 (diff)
downloadsink-101176cc504bbecf0eb36e04f250796030a10152.tar.gz
sink-101176cc504bbecf0eb36e04f250796030a10152.zip
Mailquerybenchmark stuff
Diffstat (limited to 'tests/mailquerybenchmark.cpp')
-rw-r--r--tests/mailquerybenchmark.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/tests/mailquerybenchmark.cpp b/tests/mailquerybenchmark.cpp
index 4c6f13f..4efd5cf 100644
--- a/tests/mailquerybenchmark.cpp
+++ b/tests/mailquerybenchmark.cpp
@@ -83,16 +83,10 @@ class MailQueryBenchmark : public QObject
83 pipeline->commit(); 83 pipeline->commit();
84 } 84 }
85 85
86 void testLoad(int count) 86 void testLoad(const Sink::Query &query, int count)
87 { 87 {
88 const auto startingRss = getCurrentRSS(); 88 const auto startingRss = getCurrentRSS();
89 89
90 Sink::Query query;
91 query.liveQuery = false;
92 query.requestedProperties << "uid" << "subject" << "date";
93 query.sortProperty = "date";
94 query.propertyFilter.insert("folder", "folder1");
95 query.limit = 1000;
96 90
97 //Benchmark 91 //Benchmark
98 QTime time; 92 QTime time;
@@ -115,7 +109,7 @@ class MailQueryBenchmark : public QObject
115 }); 109 });
116 emitter->fetch(Sink::ApplicationDomain::Mail::Ptr()); 110 emitter->fetch(Sink::ApplicationDomain::Mail::Ptr());
117 QTRY_VERIFY(done); 111 QTRY_VERIFY(done);
118 QCOMPARE(list.size(), count); 112 QCOMPARE(list.size(), query.limit);
119 113
120 const auto elapsed = time.elapsed(); 114 const auto elapsed = time.elapsed();
121 115
@@ -137,7 +131,7 @@ class MailQueryBenchmark : public QObject
137 std::cout << "Rss without db [kb]: " << rssWithoutDb/1024 << std::endl; 131 std::cout << "Rss without db [kb]: " << rssWithoutDb/1024 << std::endl;
138 std::cout << "Percentage error: " << percentageRssError << std::endl; 132 std::cout << "Percentage error: " << percentageRssError << std::endl;
139 133
140 HAWD::Dataset dataset("facade_query", mHawdState); 134 HAWD::Dataset dataset("mail_query", mHawdState);
141 HAWD::Dataset::Row row = dataset.row(); 135 HAWD::Dataset::Row row = dataset.row();
142 row.setValue("rows", list.size()); 136 row.setValue("rows", list.size());
143 row.setValue("queryResultPerMs", (qreal)list.size()/elapsed); 137 row.setValue("queryResultPerMs", (qreal)list.size()/elapsed);
@@ -163,8 +157,15 @@ private Q_SLOTS:
163 157
164 void test50k() 158 void test50k()
165 { 159 {
166 // populateDatabase(50000); 160 Sink::Query query;
167 testLoad(50000); 161 query.liveQuery = false;
162 query.requestedProperties << "uid" << "subject" << "date";
163 query.sortProperty = "date";
164 query.propertyFilter.insert("folder", "folder1");
165 query.limit = 1000;
166
167 populateDatabase(50000);
168 testLoad(query, 50000);
168 } 169 }
169 170
170}; 171};