| 90 | } |
| 91 | |
| 92 | void StorageRunner::parseConfig(const Poco::Util::AbstractConfiguration & config) |
| 93 | { |
| 94 | concurrency = config.getUInt("concurrency", 4); |
| 95 | max_time = config.getDouble("timelimit", 0.0); |
| 96 | report_delay = config.getDouble("report_delay", 1.0); |
| 97 | max_iterations = config.getUInt64("iterations", 0); |
| 98 | continue_on_error = config.getBool("continue_on_error", false); |
| 99 | |
| 100 | writes_per_read_batch = config.getUInt64("storage.writes_per_read_batch", 10); |
| 101 | snapshot_toggle_periods = config.getUInt64("storage.snapshot_toggle_periods", 0); |
| 102 | preprocess_commit_queue_size = config.getUInt64("storage.preprocess_commit_queue_size", 32); |
| 103 | input_queue_size = config.getUInt64("storage.input_queue_size", 2048); |
| 104 | tick_time_ms = config.getInt64("storage.tick_time_ms", 500); |
| 105 | |
| 106 | if (writes_per_read_batch == 0) |
| 107 | throw DB::Exception(DB::ErrorCodes::BAD_ARGUMENTS, "storage.writes_per_read_batch must be >= 1"); |
| 108 | if (preprocess_commit_queue_size < 2) |
| 109 | throw DB::Exception(DB::ErrorCodes::BAD_ARGUMENTS, "storage.preprocess_commit_queue_size must be >= 2"); |
| 110 | if (input_queue_size < 2) |
| 111 | throw DB::Exception(DB::ErrorCodes::BAD_ARGUMENTS, "storage.input_queue_size must be >= 2"); |
| 112 | |
| 113 | benchmark_context.initializeFromConfig(config); |
| 114 | } |
| 115 | |
| 116 | size_t StorageRunner::opIndex(Coordination::OpNum op_num) |
| 117 | { |