Fix JSON in clickhouse-benchmark; add test

This commit is contained in:
Alexey Milovidov 2020-06-11 20:53:33 +03:00
parent 89df9915bb
commit 11c79e1371
3 changed files with 12 additions and 2 deletions

View File

@ -469,7 +469,7 @@ private:
const auto & info = infos[i];
json_out << double_quote << connections[i]->getDescription() << ": {\n";
json_out << double_quote << "statistics: {\n";
json_out << double_quote << "statistics" << ": {\n";
print_key_value("QPS", info->queries / info->work_time);
print_key_value("RPS", info->read_rows / info->work_time);
@ -479,7 +479,7 @@ private:
print_key_value("num_queries", info->queries.load(), false);
json_out << "},\n";
json_out << double_quote << "query_time_percentiles: {\n";
json_out << double_quote << "query_time_percentiles" << ": {\n";
for (int percent = 0; percent <= 90; percent += 10)
print_percentile(*info, percent);

View File

@ -0,0 +1 @@
1

View File

@ -0,0 +1,9 @@
#!/usr/bin/env bash
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
. $CURDIR/../shell_config.sh
set -e
$CLICKHOUSE_BENCHMARK --iterations 10 --json ${CLICKHOUSE_TMP}/out.json <<< "SELECT 1" 2>/dev/null && cat ${CLICKHOUSE_TMP}/out.json |
$CLICKHOUSE_LOCAL --input-format JSONAsString --structure "s String" --query "SELECT isValidJSON(s) FROM table"