diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-05-11 11:58:15 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-05-11 11:58:15 +0200 |
commit | bebbc07a1c517fd9020a83a5de3efcca5b0dccca (patch) | |
tree | 49b9873503a285adc985fe619153cd5d2b808d08 | |
parent | 89c5405f200bed5f255fbf26602318b3f6426e9d (diff) | |
download | sink-bebbc07a1c517fd9020a83a5de3efcca5b0dccca.tar.gz sink-bebbc07a1c517fd9020a83a5de3efcca5b0dccca.zip |
Fixed benchmark
-rw-r--r-- | hawd_defs/mail_query_threadleader | 8 | ||||
-rw-r--r-- | tests/hawd/state.cpp | 2 | ||||
-rw-r--r-- | tests/mailquerybenchmark.cpp | 8 |
3 files changed, 13 insertions, 5 deletions
diff --git a/hawd_defs/mail_query_threadleader b/hawd_defs/mail_query_threadleader new file mode 100644 index 0000000..c555997 --- /dev/null +++ b/hawd_defs/mail_query_threadleader | |||
@@ -0,0 +1,8 @@ | |||
1 | { | ||
2 | "name": "Mail Query performance", | ||
3 | "description": "Measures performance of mail queries", | ||
4 | "columns": [ | ||
5 | { "name": "rows", "type": "int" }, | ||
6 | { "name": "queryResultPerMs", "type": "float", "unit": "result/ms" } | ||
7 | ] | ||
8 | } | ||
diff --git a/tests/hawd/state.cpp b/tests/hawd/state.cpp index 46b5f28..dfeef41 100644 --- a/tests/hawd/state.cpp +++ b/tests/hawd/state.cpp | |||
@@ -117,7 +117,7 @@ void State::findGitHash() | |||
117 | { | 117 | { |
118 | #ifdef HAVE_LIBGIT2 | 118 | #ifdef HAVE_LIBGIT2 |
119 | git_libgit2_init(); | 119 | git_libgit2_init(); |
120 | git_buf root; | 120 | git_buf root = {0}; |
121 | int error = git_repository_discover(&root, projectPath().toStdString().data(), 0, NULL); | 121 | int error = git_repository_discover(&root, projectPath().toStdString().data(), 0, NULL); |
122 | if (!error) { | 122 | if (!error) { |
123 | git_repository *repo = NULL; | 123 | git_repository *repo = NULL; |
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 | ||