| 1 | #pragma once |
|---|---|
| 2 | #include <string> |
| 3 | #include <vector> |
| 4 | #include <map> |
| 5 | #include <Core/Settings.h> |
| 6 | #include <Poco/Util/XMLConfiguration.h> |
| 7 | #include <Poco/AutoPtr.h> |
| 8 | |
| 9 | #include "StopConditionsSet.h" |
| 10 | #include "TestStopConditions.h" |
| 11 | #include "TestStats.h" |
| 12 | |
| 13 | namespace DB |
| 14 | { |
| 15 | enum class ExecutionType |
| 16 | { |
| 17 | Loop, |
| 18 | Once |
| 19 | }; |
| 20 | |
| 21 | using XMLConfiguration = Poco::Util::XMLConfiguration; |
| 22 | using XMLConfigurationPtr = Poco::AutoPtr<XMLConfiguration>; |
| 23 | using StringToVector = std::map<std::string, Strings>; |
| 24 | |
| 25 | /// Class containing all info to run performance test |
| 26 | class PerformanceTestInfo |
| 27 | { |
| 28 | public: |
| 29 | PerformanceTestInfo(XMLConfigurationPtr config, const std::string & profiles_file_, const Settings & global_settings_); |
| 30 | |
| 31 | std::string test_name; |
| 32 | std::string path; |
| 33 | std::string main_metric; |
| 34 | |
| 35 | Strings queries; |
| 36 | |
| 37 | std::string profiles_file; |
| 38 | Settings settings; |
| 39 | ExecutionType exec_type; |
| 40 | StringToVector substitutions; |
| 41 | size_t times_to_run; |
| 42 | |
| 43 | std::vector<TestStopConditions> stop_conditions_by_run; |
| 44 | |
| 45 | Strings create_and_fill_queries; |
| 46 | Strings drop_queries; |
| 47 | |
| 48 | private: |
| 49 | void applySettings(XMLConfigurationPtr config); |
| 50 | void extractQueries(XMLConfigurationPtr config); |
| 51 | void processSubstitutions(XMLConfigurationPtr config); |
| 52 | void getExecutionType(XMLConfigurationPtr config); |
| 53 | void getStopConditions(XMLConfigurationPtr config); |
| 54 | void extractAuxiliaryQueries(XMLConfigurationPtr config); |
| 55 | }; |
| 56 | |
| 57 | } |
| 58 |