diff options
-rw-r--r-- | hawd_defs/facade_query | 8 | ||||
-rw-r--r-- | tests/databasepopulationandfacadequerybenchmark.cpp | 11 |
2 files changed, 19 insertions, 0 deletions
diff --git a/hawd_defs/facade_query b/hawd_defs/facade_query new file mode 100644 index 0000000..8567a5d --- /dev/null +++ b/hawd_defs/facade_query | |||
@@ -0,0 +1,8 @@ | |||
1 | { | ||
2 | "name": "Read performance", | ||
3 | "description": "Measures performance of the query system", | ||
4 | "columns": [ | ||
5 | { "name": "rows", "type": "int" }, | ||
6 | { "name": "queryTimePerResult", "type": "float", "unit": "result/ms" } | ||
7 | ] | ||
8 | } | ||
diff --git a/tests/databasepopulationandfacadequerybenchmark.cpp b/tests/databasepopulationandfacadequerybenchmark.cpp index 77573a0..93f15cb 100644 --- a/tests/databasepopulationandfacadequerybenchmark.cpp +++ b/tests/databasepopulationandfacadequerybenchmark.cpp | |||
@@ -12,6 +12,9 @@ | |||
12 | #include <common/query.h> | 12 | #include <common/query.h> |
13 | #include <common/clientapi.h> | 13 | #include <common/clientapi.h> |
14 | 14 | ||
15 | #include "hawd/dataset.h" | ||
16 | #include "hawd/formatter.h" | ||
17 | |||
15 | #include <iostream> | 18 | #include <iostream> |
16 | #include <math.h> | 19 | #include <math.h> |
17 | 20 | ||
@@ -31,6 +34,7 @@ class DatabasePopulationAndFacadeQueryBenchmark : public QObject | |||
31 | QByteArray identifier; | 34 | QByteArray identifier; |
32 | QList<double> mRssGrowthPerEntity; | 35 | QList<double> mRssGrowthPerEntity; |
33 | QList<double> mTimePerEntity; | 36 | QList<double> mTimePerEntity; |
37 | HAWD::State mHawdState; | ||
34 | 38 | ||
35 | void populateDatabase(int count) | 39 | void populateDatabase(int count) |
36 | { | 40 | { |
@@ -129,6 +133,13 @@ class DatabasePopulationAndFacadeQueryBenchmark : public QObject | |||
129 | std::cout << "Rss without db [kb]: " << rssWithoutDb/1024 << std::endl; | 133 | std::cout << "Rss without db [kb]: " << rssWithoutDb/1024 << std::endl; |
130 | std::cout << "Percentage error: " << percentageRssError << std::endl; | 134 | std::cout << "Percentage error: " << percentageRssError << std::endl; |
131 | 135 | ||
136 | HAWD::Dataset dataset("facade_query", mHawdState); | ||
137 | HAWD::Dataset::Row row = dataset.row(); | ||
138 | row.setValue("rows", list.size()); | ||
139 | row.setValue("queryTimePerResult", (qreal)list.size()/elapsed); | ||
140 | dataset.insertRow(row); | ||
141 | HAWD::Formatter::print(dataset); | ||
142 | |||
132 | mTimePerEntity << static_cast<double>(elapsed)/static_cast<double>(count); | 143 | mTimePerEntity << static_cast<double>(elapsed)/static_cast<double>(count); |
133 | mRssGrowthPerEntity << rssGrowthPerEntity; | 144 | mRssGrowthPerEntity << rssGrowthPerEntity; |
134 | 145 | ||