summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--hawd_defs/generic_write_in_process11
-rw-r--r--hawd_defs/generic_write_in_process_with_indexes11
-rw-r--r--tests/genericresourcebenchmark.cpp32
3 files changed, 49 insertions, 5 deletions
diff --git a/hawd_defs/generic_write_in_process b/hawd_defs/generic_write_in_process
new file mode 100644
index 0000000..b597fea
--- /dev/null
+++ b/hawd_defs/generic_write_in_process
@@ -0,0 +1,11 @@
1{
2 "name": "In process write using GenericResource",
3 "description": "Measures performance of the GenericResource class",
4 "columns": {
5 "rows": { "type": "int" },
6 "append": { "type": "int", "unit": "ms", "min": 0, "max": 100 },
7 "appendOps": { "type": "float", "unit": "ops/ms" },
8 "total": { "type": "int", "unit": "ms", "min": 0, "max": 100 },
9 "totalOps": { "type": "float", "unit": "ops/ms" }
10 }
11}
diff --git a/hawd_defs/generic_write_in_process_with_indexes b/hawd_defs/generic_write_in_process_with_indexes
new file mode 100644
index 0000000..1c32276
--- /dev/null
+++ b/hawd_defs/generic_write_in_process_with_indexes
@@ -0,0 +1,11 @@
1{
2 "name": "In process write using GenericResource with indexing",
3 "description": "Measures performance of the GenericResource class with indexing",
4 "columns": {
5 "rows": { "type": "int" },
6 "append": { "type": "int", "unit": "ms", "min": 0, "max": 100 },
7 "appendOps": { "type": "float", "unit": "ops/ms" },
8 "total": { "type": "int", "unit": "ms", "min": 0, "max": 100 },
9 "totalOps": { "type": "float", "unit": "ops/ms" }
10 }
11}
diff --git a/tests/genericresourcebenchmark.cpp b/tests/genericresourcebenchmark.cpp
index 27678b0..7d0d73a 100644
--- a/tests/genericresourcebenchmark.cpp
+++ b/tests/genericresourcebenchmark.cpp
@@ -15,6 +15,9 @@
15#include "index.h" 15#include "index.h"
16#include <iostream> 16#include <iostream>
17 17
18#include "hawd/dataset.h"
19#include "hawd/formatter.h"
20
18class TestResource : public Akonadi2::GenericResource 21class TestResource : public Akonadi2::GenericResource
19{ 22{
20public: 23public:
@@ -123,13 +126,21 @@ private Q_SLOTS:
123 126
124 auto allProcessedTime = time.elapsed(); 127 auto allProcessedTime = time.elapsed();
125 128
126 std::cout << "Append to messagequeue " << appendTime << " /sec " << num*1000/appendTime << std::endl; 129 HAWD::Dataset dataset("generic_write_in_process", m_hawdState);
127 std::cout << "All processed: " << allProcessedTime << " /sec " << num*1000/allProcessedTime << std::endl; 130 HAWD::Dataset::Row row = dataset.row();
131
132 row.setValue("rows", num);
133 row.setValue("append", appendTime);
134 row.setValue("appendOps", (qreal)num/appendTime);
135 row.setValue("total", allProcessedTime);
136 row.setValue("totalOps", (qreal)num/allProcessedTime);
137 dataset.insertRow(row);
138 HAWD::Formatter::print(dataset);
128 } 139 }
129 140
130 void testWriteInProcessWithIndex() 141 void testWriteInProcessWithIndex()
131 { 142 {
132 int num = 10000; 143 int num = 50000;
133 144
134 auto pipeline = QSharedPointer<Akonadi2::Pipeline>::create("org.kde.test.instance1"); 145 auto pipeline = QSharedPointer<Akonadi2::Pipeline>::create("org.kde.test.instance1");
135 146
@@ -167,8 +178,16 @@ private Q_SLOTS:
167 178
168 auto allProcessedTime = time.elapsed(); 179 auto allProcessedTime = time.elapsed();
169 180
170 std::cout << "Append to messagequeue " << appendTime << " /sec " << num*1000/appendTime << std::endl; 181 HAWD::Dataset dataset("generic_write_in_process_with_indexes", m_hawdState);
171 std::cout << "All processed: " << allProcessedTime << " /sec " << num*1000/allProcessedTime << std::endl; 182 HAWD::Dataset::Row row = dataset.row();
183
184 row.setValue("rows", num);
185 row.setValue("append", appendTime);
186 row.setValue("appendOps", (qreal)num/appendTime);
187 row.setValue("total", allProcessedTime);
188 row.setValue("totalOps", (qreal)num/allProcessedTime);
189 dataset.insertRow(row);
190 HAWD::Formatter::print(dataset);
172 } 191 }
173 192
174 void testCreateCommand() 193 void testCreateCommand()
@@ -191,6 +210,9 @@ private Q_SLOTS:
191 Akonadi2::Commands::FinishCreateEntityBuffer(fbb, location); 210 Akonadi2::Commands::FinishCreateEntityBuffer(fbb, location);
192 } 211 }
193 } 212 }
213
214private:
215 HAWD::State m_hawdState;
194}; 216};
195 217
196QTEST_MAIN(GenericResourceBenchmark) 218QTEST_MAIN(GenericResourceBenchmark)