Update /ok to serve dual health check/benchmarking role
This commit is contained in:
@@ -14,6 +14,7 @@ ConfigParser::load_from_file(const std::string &file_path) {
|
||||
parse_server_config(toml_data, config.server);
|
||||
parse_commit_config(toml_data, config.commit);
|
||||
parse_subscription_config(toml_data, config.subscription);
|
||||
parse_benchmark_config(toml_data, config.benchmark);
|
||||
|
||||
if (!validate_config(config)) {
|
||||
return std::nullopt;
|
||||
@@ -36,6 +37,7 @@ ConfigParser::parse_toml_string(const std::string &toml_content) {
|
||||
parse_server_config(toml_data, config.server);
|
||||
parse_commit_config(toml_data, config.commit);
|
||||
parse_subscription_config(toml_data, config.subscription);
|
||||
parse_benchmark_config(toml_data, config.benchmark);
|
||||
|
||||
if (!validate_config(config)) {
|
||||
return std::nullopt;
|
||||
@@ -146,6 +148,13 @@ void ConfigParser::parse_subscription_config(const auto &toml_data,
|
||||
});
|
||||
}
|
||||
|
||||
void ConfigParser::parse_benchmark_config(const auto &toml_data,
|
||||
BenchmarkConfig &config) {
|
||||
parse_section(toml_data, "benchmark", [&](const auto &bench) {
|
||||
parse_field(bench, "ok_resolve_iterations", config.ok_resolve_iterations);
|
||||
});
|
||||
}
|
||||
|
||||
bool ConfigParser::validate_config(const Config &config) {
|
||||
bool valid = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user