pub struct HealthCheckConfig {
pub failure_threshold: f64,
pub check_window: usize,
pub min_requests: usize,
pub recovery_timeout: Duration,
}Expand description
Health check configuration
Fields§
§failure_threshold: f64Failure rate threshold to mark provider as unhealthy (0.0-1.0)
check_window: usizeNumber of recent requests to consider for health calculation
min_requests: usizeMinimum number of requests before health check is active
recovery_timeout: DurationHow long to wait before re-enabling an unhealthy provider
Implementations§
Source§impl HealthCheckConfig
impl HealthCheckConfig
Sourcepub fn with_failure_threshold(self, threshold: f64) -> Self
pub fn with_failure_threshold(self, threshold: f64) -> Self
Set the failure threshold (0.0-1.0)
Sourcepub fn with_check_window(self, window: usize) -> Self
pub fn with_check_window(self, window: usize) -> Self
Set the check window size
Sourcepub fn with_min_requests(self, min: usize) -> Self
pub fn with_min_requests(self, min: usize) -> Self
Set the minimum requests before health checking
Sourcepub fn with_recovery_timeout_secs(self, secs: u64) -> Self
pub fn with_recovery_timeout_secs(self, secs: u64) -> Self
Set the recovery timeout in seconds
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
Auto Trait Implementations§
impl Freeze for HealthCheckConfig
impl RefUnwindSafe for HealthCheckConfig
impl Send for HealthCheckConfig
impl Sync for HealthCheckConfig
impl Unpin for HealthCheckConfig
impl UnwindSafe for HealthCheckConfig
Blanket Implementations§
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