pub struct HealthCheckConfig {
pub check_type: HealthCheckType,
pub expected_status: u16,
pub healthy_threshold: u32,
pub interval_ms: u64,
pub passive_healthy_threshold: Option<u32>,
pub passive_unhealthy_threshold: Option<u32>,
pub path: String,
pub timeout_ms: u64,
pub unhealthy_threshold: u32,
}Expand description
Per-cluster health check settings (active and passive).
Active checking configures periodic probing of upstream endpoints. Passive checking observes real request outcomes (5xx responses, connection errors) to update health state.
let yaml = r#"
type: http
path: "/healthz"
expected_status: 200
interval_ms: 5000
timeout_ms: 2000
healthy_threshold: 2
unhealthy_threshold: 3
passive_unhealthy_threshold: 5
passive_healthy_threshold: 3
"#;
let hc: HealthCheckConfig = serde_yaml::from_str(yaml).unwrap();
assert_eq!(hc.check_type, HealthCheckType::Http);
assert_eq!(hc.path, "/healthz");
assert_eq!(hc.interval_ms, 5000);
assert_eq!(hc.passive_unhealthy_threshold, Some(5));
assert_eq!(hc.passive_healthy_threshold, Some(3));Fields§
§check_type: HealthCheckType§expected_status: u16Expected HTTP status code for a healthy response.
healthy_threshold: u32Consecutive successes required to mark an endpoint healthy.
interval_ms: u64Probe interval in milliseconds.
passive_healthy_threshold: Option<u32>Consecutive successes to mark an endpoint healthy again
via passive observation. None disables passive recovery
(active checks must recover it).
passive_unhealthy_threshold: Option<u32>Consecutive response failures (5xx or connect error) to
mark an endpoint unhealthy via passive observation.
None disables passive checking.
path: StringHTTP path to probe (only used for http type).
timeout_ms: u64Probe timeout in milliseconds. Must be less than interval_ms.
unhealthy_threshold: u32Consecutive failures required to mark an endpoint unhealthy.
Trait Implementations§
Source§impl Clone for HealthCheckConfig
impl Clone for HealthCheckConfig
Source§fn clone(&self) -> HealthCheckConfig
fn clone(&self) -> HealthCheckConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more