diff options
author | Christian Mollekopf <mollekopf@kolabsystems.com> | 2017-10-12 16:10:17 +0200 |
---|---|---|
committer | Christian Mollekopf <mollekopf@kolabsystems.com> | 2017-10-12 16:10:17 +0200 |
commit | da0e1bb93de6d45c261a0e48f024f1b0ce92b2d2 (patch) | |
tree | 8852bda1939c64d93b44b3608ba3c649d6adad3c /tests/hawd | |
parent | 85f77b641d06faf934e54e6f154a31844d94627b (diff) | |
download | sink-da0e1bb93de6d45c261a0e48f024f1b0ce92b2d2.tar.gz sink-da0e1bb93de6d45c261a0e48f024f1b0ce92b2d2.zip |
Changed how we record and print the mail query benchmark data.
Each column can represent an individual value, which we can use to
record related data. Each row thus represents a new run of the
benchmark.
Diffstat (limited to 'tests/hawd')
-rw-r--r-- | tests/hawd/modules/json.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/hawd/modules/json.cpp b/tests/hawd/modules/json.cpp index d08df49..d299761 100644 --- a/tests/hawd/modules/json.cpp +++ b/tests/hawd/modules/json.cpp | |||
@@ -73,9 +73,15 @@ bool Json::toJson(const QStringList &commands, State &state) | |||
73 | QJsonObject jsonRow; | 73 | QJsonObject jsonRow; |
74 | jsonRow.insert("timestamp", QJsonValue::fromVariant(row.timestamp())); | 74 | jsonRow.insert("timestamp", QJsonValue::fromVariant(row.timestamp())); |
75 | jsonRow.insert("commit", row.commitHash()); | 75 | jsonRow.insert("commit", row.commitHash()); |
76 | QJsonArray columnsArray; | ||
76 | for (const auto &col : columns) { | 77 | for (const auto &col : columns) { |
77 | jsonRow.insert(col.first, QJsonValue::fromVariant(row.value(col.first))); | 78 | QJsonObject columnObject; |
79 | columnObject.insert("unit", QJsonValue::fromVariant(col.second.unit())); | ||
80 | columnObject.insert("name", QJsonValue::fromVariant(col.first)); | ||
81 | columnObject.insert("value", QJsonValue::fromVariant(row.value(col.first))); | ||
82 | columnsArray << columnObject; | ||
78 | } | 83 | } |
84 | jsonRow.insert("columns", columnsArray); | ||
79 | array.append(jsonRow); | 85 | array.append(jsonRow); |
80 | }); | 86 | }); |
81 | json.insert("rows", array); | 87 | json.insert("rows", array); |