diff options
Diffstat (limited to 'tests/databasepopulationandfacadequerybenchmark.cpp')
-rw-r--r-- | tests/databasepopulationandfacadequerybenchmark.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/databasepopulationandfacadequerybenchmark.cpp b/tests/databasepopulationandfacadequerybenchmark.cpp index 8581c49..63daebc 100644 --- a/tests/databasepopulationandfacadequerybenchmark.cpp +++ b/tests/databasepopulationandfacadequerybenchmark.cpp | |||
@@ -10,7 +10,10 @@ | |||
10 | #include <common/synclistresult.h> | 10 | #include <common/synclistresult.h> |
11 | #include <common/definitions.h> | 11 | #include <common/definitions.h> |
12 | #include <common/query.h> | 12 | #include <common/query.h> |
13 | #include <common/clientapi.h> | 13 | #include <common/store.h> |
14 | |||
15 | #include "hawd/dataset.h" | ||
16 | #include "hawd/formatter.h" | ||
14 | 17 | ||
15 | #include <iostream> | 18 | #include <iostream> |
16 | #include <math.h> | 19 | #include <math.h> |
@@ -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 | { |
@@ -40,7 +44,7 @@ class DatabasePopulationAndFacadeQueryBenchmark : public QObject | |||
40 | { | 44 | { |
41 | Sink::Storage storage(Sink::storageLocation(), identifier, Sink::Storage::ReadWrite); | 45 | Sink::Storage storage(Sink::storageLocation(), identifier, Sink::Storage::ReadWrite); |
42 | auto transaction = storage.createTransaction(Sink::Storage::ReadWrite); | 46 | auto transaction = storage.createTransaction(Sink::Storage::ReadWrite); |
43 | auto db = transaction.openDatabase("event.main"); | 47 | auto db = Sink::Storage::mainDatabase(transaction, "event"); |
44 | 48 | ||
45 | int bufferSizeTotal = 0; | 49 | int bufferSizeTotal = 0; |
46 | int keysSizeTotal = 0; | 50 | int keysSizeTotal = 0; |
@@ -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 | ||