Update /ok to serve dual health check/benchmarking role

This commit is contained in:
2025-09-05 12:39:10 -04:00
parent 761eaa552b
commit e67e4aee17
15 changed files with 265 additions and 53 deletions

View File

@@ -74,6 +74,15 @@ struct SubscriptionConfig {
std::chrono::seconds keepalive_interval{30};
};
/**
* @brief Configuration settings for benchmarking and health check behavior.
*/
struct BenchmarkConfig {
/// CPU-intensive loop iterations for /ok requests in resolve stage
/// 0 = health check only, 7000 = default benchmark load (650ns, 1M req/s)
int ok_resolve_iterations = 7000;
};
/**
* @brief Top-level configuration container for all WeaselDB settings.
*/
@@ -81,6 +90,7 @@ struct Config {
ServerConfig server; ///< Server networking and request handling settings
CommitConfig commit; ///< Commit processing and validation settings
SubscriptionConfig subscription; ///< Subscription streaming settings
BenchmarkConfig benchmark; ///< Benchmarking and health check settings
};
/**
@@ -152,6 +162,8 @@ private:
static void parse_commit_config(const auto &toml_data, CommitConfig &config);
static void parse_subscription_config(const auto &toml_data,
SubscriptionConfig &config);
static void parse_benchmark_config(const auto &toml_data,
BenchmarkConfig &config);
};
} // namespace weaseldb