#pragma once #include #include #include #include #include "PerformanceTestInfo.h" namespace DB { using XMLConfiguration = Poco::Util::XMLConfiguration; using XMLConfigurationPtr = Poco::AutoPtr; using QueriesWithIndexes = std::vector>; class PerformanceTest { public: PerformanceTest( const XMLConfigurationPtr & config_, Connection & connection_, InterruptListener & interrupt_listener_, const PerformanceTestInfo & test_info_, Context & context_); bool checkPreconditions() const; std::vector execute(); const PerformanceTestInfo & getTestInfo() const { return test_info; } bool checkSIGINT() const { return got_SIGINT; } private: void runQueries( const QueriesWithIndexes & queries_with_indexes, std::vector & statistics_by_run); UInt64 calculateMaxExecTime() const; private: XMLConfigurationPtr config; Connection & connection; InterruptListener & interrupt_listener; PerformanceTestInfo test_info; Context & context; Poco::Logger * log; bool got_SIGINT = false; }; }