summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-10-17 16:06:24 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-10-17 16:06:24 +0200
commit249b0fc1f39df819986668d0c82e97e77c23a7c7 (patch)
tree5c28d15d60131ecb8ae11f9620462429807c8500
parent833aabc562c51fa962f9f2da14f7cd4552dab22b (diff)
downloadsink-249b0fc1f39df819986668d0c82e97e77c23a7c7.tar.gz
sink-249b0fc1f39df819986668d0c82e97e77c23a7c7.zip
storagebenchmark
-rw-r--r--hawd_defs/storage_sizes9
-rw-r--r--tests/storagebenchmark.cpp20
2 files changed, 21 insertions, 8 deletions
diff --git a/hawd_defs/storage_sizes b/hawd_defs/storage_sizes
new file mode 100644
index 0000000..bdf40ae
--- /dev/null
+++ b/hawd_defs/storage_sizes
@@ -0,0 +1,9 @@
1{
2 "name": "Storage Read/Write db sizes",
3 "description": "Compare db size to a simple file size",
4 "columns": [
5 { "name": "rows", "type": "int" },
6 { "name": "dbSize", "type": "float", "unit": "kb" },
7 { "name": "fileSize", "type": "float", "unit": "kb" }
8 ]
9}
diff --git a/tests/storagebenchmark.cpp b/tests/storagebenchmark.cpp
index 906844e..ee336d2 100644
--- a/tests/storagebenchmark.cpp
+++ b/tests/storagebenchmark.cpp
@@ -122,15 +122,19 @@ private slots:
122 row.setValue("dbRead", readOpsPerMs); 122 row.setValue("dbRead", readOpsPerMs);
123 dataset.insertRow(row); 123 dataset.insertRow(row);
124 HAWD::Formatter::print(dataset); 124 HAWD::Formatter::print(dataset);
125 }
126
127 void testSizes()
128 {
129 Sink::Storage::DataStore store(testDataPath, dbName);
130 qDebug() << "Database size [kb]: " << store.diskUsage() / 1024;
131 125
132 QFileInfo fileInfo(filePath); 126 {
133 qDebug() << "File size [kb]: " << fileInfo.size() / 1024; 127 Sink::Storage::DataStore store(testDataPath, dbName);
128 QFileInfo fileInfo(filePath);
129
130 HAWD::Dataset dataset("storage_sizes", m_hawdState);
131 HAWD::Dataset::Row row = dataset.row();
132 row.setValue("rows", count);
133 row.setValue("dbSize", store.diskUsage() / 1024);
134 row.setValue("fileSize", fileInfo.size() / 1024);
135 dataset.insertRow(row);
136 HAWD::Formatter::print(dataset);
137 }
134 } 138 }
135 139
136 void testScan() 140 void testScan()