From da0e1bb93de6d45c261a0e48f024f1b0ce92b2d2 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 12 Oct 2017 16:10:17 +0200 Subject: 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. --- tests/hawd/modules/json.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tests/hawd/modules/json.cpp') 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) QJsonObject jsonRow; jsonRow.insert("timestamp", QJsonValue::fromVariant(row.timestamp())); jsonRow.insert("commit", row.commitHash()); + QJsonArray columnsArray; for (const auto &col : columns) { - jsonRow.insert(col.first, QJsonValue::fromVariant(row.value(col.first))); + QJsonObject columnObject; + columnObject.insert("unit", QJsonValue::fromVariant(col.second.unit())); + columnObject.insert("name", QJsonValue::fromVariant(col.first)); + columnObject.insert("value", QJsonValue::fromVariant(row.value(col.first))); + columnsArray << columnObject; } + jsonRow.insert("columns", columnsArray); array.append(jsonRow); }); json.insert("rows", array); -- cgit v1.2.3