mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Fix JSON in clickhouse-benchmark; add test
This commit is contained in:
parent
89df9915bb
commit
11c79e1371
@ -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);
|
||||
|
1
tests/queries/0_stateless/01306_benchmark_json.reference
Normal file
1
tests/queries/0_stateless/01306_benchmark_json.reference
Normal file
@ -0,0 +1 @@
|
||||
1
|
9
tests/queries/0_stateless/01306_benchmark_json.sh
Executable file
9
tests/queries/0_stateless/01306_benchmark_json.sh
Executable 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"
|
Loading…
Reference in New Issue
Block a user