pub struct ProviderHealth {
pub provider_id: String,
pub is_reachable: bool,
pub p50_latency_ms: f64,
pub p95_latency_ms: f64,
pub p99_latency_ms: f64,
pub error_rate: f32,
pub health_score: f32,
pub last_check: Instant,
pub consecutive_failures: u32,
pub total_requests: u64,
pub total_errors: u64,
}Expand description
A point-in-time health snapshot for a single provider.
Fields§
§provider_id: StringStable identifier matching the provider key used when calling record.
is_reachable: booltrue while consecutive_failures is below the hard-failure threshold
(currently 5) and health_score > 0.0.
p50_latency_ms: f6450th-percentile latency over the current sample window (milliseconds).
p95_latency_ms: f6495th-percentile latency over the current sample window (milliseconds).
p99_latency_ms: f6499th-percentile latency over the current sample window (milliseconds).
error_rate: f32Rolling error rate in [0.0, 1.0] computed from the sample window.
health_score: f32Composite health score in [0.0, 1.0]; higher is better.
last_check: InstantMonotonic timestamp of the most recent record call.
consecutive_failures: u32Number of consecutive failures since the last success.
total_requests: u64Total successful + failed requests recorded since monitor creation.
total_errors: u64Total failed requests recorded since monitor creation.
Implementations§
Source§impl ProviderHealth
impl ProviderHealth
Sourcepub fn is_healthy(&self) -> bool
pub fn is_healthy(&self) -> bool
Sourcepub fn is_degraded(&self) -> bool
pub fn is_degraded(&self) -> bool
Sourcepub fn is_critical(&self) -> bool
pub fn is_critical(&self) -> bool
Trait Implementations§
Source§impl Clone for ProviderHealth
impl Clone for ProviderHealth
Source§fn clone(&self) -> ProviderHealth
fn clone(&self) -> ProviderHealth
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ProviderHealth
impl RefUnwindSafe for ProviderHealth
impl Send for ProviderHealth
impl Sync for ProviderHealth
impl Unpin for ProviderHealth
impl UnsafeUnpin for ProviderHealth
impl UnwindSafe for ProviderHealth
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request