| 43 | } |
| 44 | |
| 45 | StorageRunner::StorageRunner( |
| 46 | const std::string & config_path_, |
| 47 | std::optional<size_t> concurrency_, |
| 48 | std::optional<double> max_time_, |
| 49 | std::optional<double> report_delay_, |
| 50 | std::optional<size_t> max_iterations_, |
| 51 | std::optional<bool> continue_on_error_) |
| 52 | : config_path(config_path_) |
| 53 | { |
| 54 | if (config_path.empty()) |
| 55 | throw DB::Exception(DB::ErrorCodes::BAD_ARGUMENTS, "--config is required in --storage mode"); |
| 56 | |
| 57 | auto log_channel = Poco::AutoPtr<Poco::ConsoleChannel>(new Poco::ConsoleChannel(std::cerr)); |
| 58 | Poco::Logger::root().setChannel(log_channel); |
| 59 | Poco::Logger::root().setLevel("error"); |
| 60 | |
| 61 | DB::ConfigProcessor config_processor(config_path, true, false); |
| 62 | config_ptr = config_processor.loadConfig().configuration; |
| 63 | |
| 64 | parseConfig(*config_ptr); |
| 65 | |
| 66 | if (concurrency_) |
| 67 | concurrency = *concurrency_; |
| 68 | if (max_time_) |
| 69 | max_time = *max_time_; |
| 70 | if (report_delay_) |
| 71 | report_delay = *report_delay_; |
| 72 | if (max_iterations_) |
| 73 | max_iterations = *max_iterations_; |
| 74 | if (continue_on_error_) |
| 75 | continue_on_error = *continue_on_error_; |
| 76 | } |
| 77 | |
| 78 | StorageRunner::~StorageRunner() |
| 79 | { |
nothing calls this directly
no test coverage detected