pub struct HealthCheckConfig {
pub check_type: HealthCheckType,
pub path: String,
pub expected_status: u16,
pub interval_ms: u64,
pub timeout_ms: u64,
pub healthy_threshold: u32,
pub unhealthy_threshold: u32,
}Expand description
Per-cluster active health check settings.
Configures periodic probing of upstream endpoints to detect failures before routing traffic to them.
let yaml = r#"
type: http
path: "/healthz"
expected_status: 200
interval_ms: 5000
timeout_ms: 2000
healthy_threshold: 2
unhealthy_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);Fields§
§check_type: HealthCheckType§path: StringHTTP path to probe (only used for http type).
expected_status: u16Expected HTTP status code for a healthy response.
interval_ms: u64Probe interval in milliseconds.
timeout_ms: u64Probe timeout in milliseconds. Must be less than interval_ms.
healthy_threshold: u32Consecutive successes required to mark an endpoint healthy.
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
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HealthCheckConfig
impl Debug for HealthCheckConfig
Source§impl<'de> Deserialize<'de> for HealthCheckConfig
impl<'de> Deserialize<'de> for HealthCheckConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for HealthCheckConfig
impl RefUnwindSafe for HealthCheckConfig
impl Send for HealthCheckConfig
impl Sync for HealthCheckConfig
impl Unpin for HealthCheckConfig
impl UnsafeUnpin for HealthCheckConfig
impl UnwindSafe for HealthCheckConfig
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more