summaryrefslogtreecommitdiffstats
path: root/tests/storagebenchmark.cpp
diff options
context:
space:
mode:
authorAaron Seigo <aseigo@kde.org>2014-12-06 02:52:51 +0100
committerAaron Seigo <aseigo@kde.org>2014-12-06 02:52:51 +0100
commitc9abda34c6dcf39fe05d98a0b2cb53da618c6675 (patch)
treed0396cc7502797b7e8ebc264cd85cc8bd0e45a19 /tests/storagebenchmark.cpp
parent1d3aaebcaca0a77976eccb764bf8dd0eb0742546 (diff)
downloadsink-c9abda34c6dcf39fe05d98a0b2cb53da618c6675.tar.gz
sink-c9abda34c6dcf39fe05d98a0b2cb53da618c6675.zip
add a calc for ops/ms
Diffstat (limited to 'tests/storagebenchmark.cpp')
-rw-r--r--tests/storagebenchmark.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/tests/storagebenchmark.cpp b/tests/storagebenchmark.cpp
index f05cc78..665008d 100644
--- a/tests/storagebenchmark.cpp
+++ b/tests/storagebenchmark.cpp
@@ -114,8 +114,9 @@ private Q_SLOTS:
114 myfile.close(); 114 myfile.close();
115 } 115 }
116 } 116 }
117 const int writeDuration = time.restart(); 117 qreal writeDuration = time.restart();
118 qDebug() << "Writing took[ms]: " << writeDuration; 118 qreal opsPerMs = count / writeDuration;
119 qDebug() << "Writing took[ms]: " << writeDuration << "->" << opsPerMs << "ops/ms";
119 120
120 { 121 {
121 for (int i = 0; i < count; i++) { 122 for (int i = 0; i < count; i++) {
@@ -124,10 +125,11 @@ private Q_SLOTS:
124 } 125 }
125 } 126 }
126 } 127 }
127 const int readDuration = time.restart(); 128 qreal readDuration = time.restart();
129 opsPerMs = count / readDuration;
128 130
129 if (store) { 131 if (store) {
130 qDebug() << "Reading took[ms]: " << readDuration; 132 qDebug() << "Reading took[ms]: " << readDuration << "->" << opsPerMs << "ops/ms";
131 } else { 133 } else {
132 qDebug() << "File reading is not implemented."; 134 qDebug() << "File reading is not implemented.";
133 } 135 }
@@ -138,15 +140,15 @@ private Q_SLOTS:
138 void testBufferCreation() 140 void testBufferCreation()
139 { 141 {
140 QTime time; 142 QTime time;
141
142 time.start(); 143 time.start();
143 { 144
144 for (int i = 0; i < count; i++) { 145 for (int i = 0; i < count; i++) {
145 auto event = createEvent(); 146 auto event = createEvent();
146 }
147 } 147 }
148 const int bufferDuration = time.elapsed(); 148
149 qDebug() << "Creating buffers took[ms]: " << bufferDuration; 149 qreal bufferDuration = time.restart();
150 qreal opsPerMs = count / bufferDuration;
151 qDebug() << "Creating buffers took[ms]: " << bufferDuration << "->" << opsPerMs << "ops/ms";;
150 } 152 }
151 153
152 void testSizes() 154 void testSizes()