diff --git a/dbms/programs/benchmark/Benchmark.cpp b/dbms/programs/benchmark/Benchmark.cpp index d043a91b8b41..2cf8bc6fcfdc 100644 --- a/dbms/programs/benchmark/Benchmark.cpp +++ b/dbms/programs/benchmark/Benchmark.cpp @@ -80,7 +80,6 @@ class Benchmark : public Poco::Util::Application void initialize(Poco::Util::Application & self) { - Poco::Util::Application::initialize(self); std::string home_path; const char * home_path_cstr = getenv("HOME"); if (home_path_cstr) @@ -447,7 +446,7 @@ int mainEntryClickHouseBenchmark(int argc, char ** argv) ("json", value()->default_value(""), "write final report to specified file in JSON format") ("host,h", value()->default_value("localhost"), "") ("port", value()->default_value(9000), "") - ("secure", "Use TLS connection") + ("secure,s", "Use TLS connection") ("user", value()->default_value("default"), "") ("password", value()->default_value(""), "") ("database", value()->default_value("default"), "") diff --git a/dbms/programs/performance-test/PerformanceTest.cpp b/dbms/programs/performance-test/PerformanceTest.cpp index 4bdb1d640969..7ee6ce7df131 100644 --- a/dbms/programs/performance-test/PerformanceTest.cpp +++ b/dbms/programs/performance-test/PerformanceTest.cpp @@ -30,7 +30,9 @@ #include #include #include +#include #include +#include #ifndef __clang__ #pragma GCC optimize("-fno-var-tracking-assignments") @@ -487,7 +489,7 @@ struct Stats double Stats::avg_rows_speed_precision = 0.001; double Stats::avg_bytes_speed_precision = 0.001; -class PerformanceTest +class PerformanceTest : public Poco::Util::Application { public: using Strings = std::vector; @@ -524,7 +526,19 @@ class PerformanceTest { throw DB::Exception("No tests were specified", DB::ErrorCodes::BAD_ARGUMENTS); } + } + + void initialize(Poco::Util::Application & self) + { + std::string home_path; + const char * home_path_cstr = getenv("HOME"); + if (home_path_cstr) + home_path = home_path_cstr; + configReadClient(Poco::Util::Application::instance().config(), home_path); + } + int main(const std::vector < std::string > & /* args */) + { std::string name; UInt64 version_major; UInt64 version_minor; @@ -1390,7 +1404,7 @@ try ("profiles-file", value()->default_value(""), "Specify a file with global profiles") ("host,h", value()->default_value("localhost"), "") ("port", value()->default_value(9000), "") - ("secure", "Use TLS connection") + ("secure,s", "Use TLS connection") ("database", value()->default_value("default"), "") ("user", value()->default_value("default"), "") ("password", value()->default_value(""), "") @@ -1482,7 +1496,7 @@ try DB::UseSSL use_ssl; - DB::PerformanceTest performanceTest( + DB::PerformanceTest performance_test( options["host"].as(), options["port"].as(), options.count("secure"), @@ -1499,8 +1513,7 @@ try std::move(tests_names_regexp), std::move(skip_names_regexp), timeouts); - - return 0; + return performance_test.run(); } catch (...) {