diff --git a/programs/benchmark/Benchmark.cpp b/programs/benchmark/Benchmark.cpp index 89b9a877d5e..8da164d01d6 100644 --- a/programs/benchmark/Benchmark.cpp +++ b/programs/benchmark/Benchmark.cpp @@ -84,7 +84,8 @@ public: UInt16 cur_port = i >= ports_.size() ? 9000 : ports_[i]; std::string cur_host = i >= hosts_.size() ? "localhost" : hosts_[i]; - connections.emplace_back(std::make_unique(concurrency, cur_host, cur_port, default_database_, user_, password_, "benchmark", Protocol::Compression::Enable, secure)); + connections.emplace_back(std::make_unique( + concurrency, cur_host, cur_port, default_database_, user_, password_, "benchmark", Protocol::Compression::Enable, secure)); comparison_info_per_interval.emplace_back(std::make_shared()); comparison_info_total.emplace_back(std::make_shared()); } @@ -563,7 +564,7 @@ int mainEntryClickHouseBenchmark(int argc, char ** argv) desc.add_options() ("help", "produce help message") ("concurrency,c", value()->default_value(1), "number of parallel queries") - ("delay,d", value()->default_value(1), "delay between intermediate reports in seconds (set 0 to disable reports)") + ("delay,d", value()->default_value(1), "delay between intermediate reports in seconds (set 0 to disable reports)") ("stage", value()->default_value("complete"), "request query processing up to specified stage: complete,fetch_columns,with_mergeable_state") ("iterations,i", value()->default_value(0), "amount of queries to be executed") ("timelimit,t", value()->default_value(0.), "stop launch of queries after specified time limit") @@ -600,8 +601,15 @@ int mainEntryClickHouseBenchmark(int argc, char ** argv) print_stacktrace = options.count("stacktrace"); + /// NOTE Maybe clickhouse-benchmark should also respect .xml configuration of clickhouse-client. + + UInt16 default_port = options.count("secure") ? DBMS_DEFAULT_SECURE_PORT : DBMS_DEFAULT_PORT; + UseSSL use_ssl; - Ports ports = options.count("port") ? options["port"].as() : Ports({9000}); + Ports ports = options.count("port") + ? options["port"].as() + : Ports({default_port}); + Strings hosts = options.count("host") ? options["host"].as() : Strings({"localhost"}); Benchmark benchmark( diff --git a/tests/queries/0_stateless/01393_benchmark_secure_port.reference b/tests/queries/0_stateless/01393_benchmark_secure_port.reference new file mode 100644 index 00000000000..4615c5c648a --- /dev/null +++ b/tests/queries/0_stateless/01393_benchmark_secure_port.reference @@ -0,0 +1 @@ +Queries executed: 100. diff --git a/tests/queries/0_stateless/01393_benchmark_secure_port.sh b/tests/queries/0_stateless/01393_benchmark_secure_port.sh new file mode 100755 index 00000000000..32f092ca58a --- /dev/null +++ b/tests/queries/0_stateless/01393_benchmark_secure_port.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +. $CURDIR/../shell_config.sh + +$CLICKHOUSE_BENCHMARK --secure -i 100 <<< 'SELECT 1' 2>&1 | grep -F 'Queries executed'