Correct default secure port for clickhouse-benchmark #11044

This commit is contained in:
Alexey Milovidov 2020-07-12 21:54:13 +03:00
parent d64e51d1a7
commit e8a3f0abb3
3 changed files with 18 additions and 3 deletions

View File

@ -84,7 +84,8 @@ public:
UInt16 cur_port = i >= ports_.size() ? 9000 : ports_[i]; UInt16 cur_port = i >= ports_.size() ? 9000 : ports_[i];
std::string cur_host = i >= hosts_.size() ? "localhost" : hosts_[i]; std::string cur_host = i >= hosts_.size() ? "localhost" : hosts_[i];
connections.emplace_back(std::make_unique<ConnectionPool>(concurrency, cur_host, cur_port, default_database_, user_, password_, "benchmark", Protocol::Compression::Enable, secure)); connections.emplace_back(std::make_unique<ConnectionPool>(
concurrency, cur_host, cur_port, default_database_, user_, password_, "benchmark", Protocol::Compression::Enable, secure));
comparison_info_per_interval.emplace_back(std::make_shared<Stats>()); comparison_info_per_interval.emplace_back(std::make_shared<Stats>());
comparison_info_total.emplace_back(std::make_shared<Stats>()); comparison_info_total.emplace_back(std::make_shared<Stats>());
} }
@ -600,8 +601,15 @@ int mainEntryClickHouseBenchmark(int argc, char ** argv)
print_stacktrace = options.count("stacktrace"); 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; UseSSL use_ssl;
Ports ports = options.count("port") ? options["port"].as<Ports>() : Ports({9000}); Ports ports = options.count("port")
? options["port"].as<Ports>()
: Ports({default_port});
Strings hosts = options.count("host") ? options["host"].as<Strings>() : Strings({"localhost"}); Strings hosts = options.count("host") ? options["host"].as<Strings>() : Strings({"localhost"});
Benchmark benchmark( Benchmark benchmark(

View File

@ -0,0 +1 @@
Queries executed: 100.

View File

@ -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'