Skip to content

Commit

Permalink
PerformanceTest fix --secure (ClickHouse#3690)
Browse files Browse the repository at this point in the history
* fix

* PerformanceTest fix --secure

* clean
  • Loading branch information
proller committed Nov 30, 2018
1 parent 65a1163 commit 9d7b8c5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
3 changes: 1 addition & 2 deletions dbms/programs/benchmark/Benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -447,7 +446,7 @@ int mainEntryClickHouseBenchmark(int argc, char ** argv)
("json", value<std::string>()->default_value(""), "write final report to specified file in JSON format")
("host,h", value<std::string>()->default_value("localhost"), "")
("port", value<UInt16>()->default_value(9000), "")
("secure", "Use TLS connection")
("secure,s", "Use TLS connection")
("user", value<std::string>()->default_value("default"), "")
("password", value<std::string>()->default_value(""), "")
("database", value<std::string>()->default_value("default"), "")
Expand Down
23 changes: 18 additions & 5 deletions dbms/programs/performance-test/PerformanceTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
#include <Poco/SAX/InputSource.h>
#include <Poco/Util/XMLConfiguration.h>
#include <Poco/XML/XMLStream.h>
#include <Poco/Util/Application.h>
#include <Common/InterruptListener.h>
#include <Common/Config/configReadClient.h>

#ifndef __clang__
#pragma GCC optimize("-fno-var-tracking-assignments")
Expand Down Expand Up @@ -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<String>;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -1390,7 +1404,7 @@ try
("profiles-file", value<String>()->default_value(""), "Specify a file with global profiles")
("host,h", value<String>()->default_value("localhost"), "")
("port", value<UInt16>()->default_value(9000), "")
("secure", "Use TLS connection")
("secure,s", "Use TLS connection")
("database", value<String>()->default_value("default"), "")
("user", value<String>()->default_value("default"), "")
("password", value<String>()->default_value(""), "")
Expand Down Expand Up @@ -1482,7 +1496,7 @@ try

DB::UseSSL use_ssl;

DB::PerformanceTest performanceTest(
DB::PerformanceTest performance_test(
options["host"].as<String>(),
options["port"].as<UInt16>(),
options.count("secure"),
Expand All @@ -1499,8 +1513,7 @@ try
std::move(tests_names_regexp),
std::move(skip_names_regexp),
timeouts);

return 0;
return performance_test.run();
}
catch (...)
{
Expand Down

0 comments on commit 9d7b8c5

Please sign in to comment.