Update /ok to serve dual health check/benchmarking role
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user