diff options
author | Aaron Seigo <aseigo@kde.org> | 2014-12-09 22:10:10 +0100 |
---|---|---|
committer | Aaron Seigo <aseigo@kde.org> | 2014-12-11 01:01:13 +0100 |
commit | 14d39a72cdd3b857b5d9da7d2ca50dd5ae670b53 (patch) | |
tree | 1f7e6aa080c8c4b17a794864f8efe13690735686 /tests/storagebenchmark.cpp | |
parent | 476035d5e336f318e66a3372d251f799ff408562 (diff) | |
download | sink-14d39a72cdd3b857b5d9da7d2ca50dd5ae670b53.tar.gz sink-14d39a72cdd3b857b5d9da7d2ca50dd5ae670b53.zip |
store benchmark data for storage read/write
Diffstat (limited to 'tests/storagebenchmark.cpp')
-rw-r--r-- | tests/storagebenchmark.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/tests/storagebenchmark.cpp b/tests/storagebenchmark.cpp index c1d4dc8..ba14990 100644 --- a/tests/storagebenchmark.cpp +++ b/tests/storagebenchmark.cpp | |||
@@ -116,8 +116,8 @@ private Q_SLOTS: | |||
116 | } | 116 | } |
117 | } | 117 | } |
118 | qreal writeDuration = time.restart(); | 118 | qreal writeDuration = time.restart(); |
119 | qreal opsPerMs = count / writeDuration; | 119 | qreal writeOpsPerMs = count / writeDuration; |
120 | qDebug() << "Writing took[ms]: " << writeDuration << "->" << opsPerMs << "ops/ms"; | 120 | qDebug() << "Writing took[ms]: " << writeDuration << "->" << writeOpsPerMs << "ops/ms"; |
121 | 121 | ||
122 | { | 122 | { |
123 | for (int i = 0; i < count; i++) { | 123 | for (int i = 0; i < count; i++) { |
@@ -127,10 +127,18 @@ private Q_SLOTS: | |||
127 | } | 127 | } |
128 | } | 128 | } |
129 | qreal readDuration = time.restart(); | 129 | qreal readDuration = time.restart(); |
130 | opsPerMs = count / readDuration; | 130 | qreal readOpsPerMs = count / readDuration; |
131 | 131 | ||
132 | if (store) { | 132 | if (store) { |
133 | qDebug() << "Reading took[ms]: " << readDuration << "->" << opsPerMs << "ops/ms"; | 133 | HAWD::Dataset dataset("storage_readwrite", m_hawdState); |
134 | HAWD::Dataset::Row row = dataset.row(); | ||
135 | row.setValue("rows", count); | ||
136 | row.setValue("write", writeDuration); | ||
137 | row.setValue("writeOps", writeOpsPerMs); | ||
138 | row.setValue("read", readOpsPerMs); | ||
139 | row.setValue("readOps", readOpsPerMs); | ||
140 | dataset.insertRow(row); | ||
141 | qDebug() << "Reading took[ms]: " << readDuration << "->" << readOpsPerMs << "ops/ms"; | ||
134 | } else { | 142 | } else { |
135 | qDebug() << "File reading is not implemented."; | 143 | qDebug() << "File reading is not implemented."; |
136 | } | 144 | } |
@@ -172,8 +180,7 @@ private Q_SLOTS: | |||
172 | 180 | ||
173 | void testBufferCreation() | 181 | void testBufferCreation() |
174 | { | 182 | { |
175 | HAWD::State state; | 183 | HAWD::Dataset dataset("buffer_creation", m_hawdState); |
176 | HAWD::Dataset dataset("buffer_creation", state); | ||
177 | HAWD::Dataset::Row row = dataset.row(); | 184 | HAWD::Dataset::Row row = dataset.row(); |
178 | 185 | ||
179 | QTime time; | 186 | QTime time; |
@@ -200,6 +207,10 @@ private Q_SLOTS: | |||
200 | QFileInfo fileInfo(filePath); | 207 | QFileInfo fileInfo(filePath); |
201 | qDebug() << "File size [kb]: " << fileInfo.size()/1024; | 208 | qDebug() << "File size [kb]: " << fileInfo.size()/1024; |
202 | } | 209 | } |
210 | |||
211 | |||
212 | private: | ||
213 | HAWD::State m_hawdState; | ||
203 | }; | 214 | }; |
204 | 215 | ||
205 | QTEST_MAIN(StorageBenchmark) | 216 | QTEST_MAIN(StorageBenchmark) |