pub struct ModelHealth { /* private fields */ }Expand description
Model health status for readiness probes
Implementations§
Source§impl ModelHealth
impl ModelHealth
Sourcepub fn new() -> ModelHealth
pub fn new() -> ModelHealth
Create new health tracker
Sourcepub fn status(&self) -> WarmupStatus
pub fn status(&self) -> WarmupStatus
Get current status
Sourcepub fn set_status(&self, status: WarmupStatus)
pub fn set_status(&self, status: WarmupStatus)
Set status
Sourcepub fn record_success(&self)
pub fn record_success(&self)
Record a successful request
Sourcepub fn record_failure(&self)
pub fn record_failure(&self)
Record a failed request
Sourcepub fn total_requests(&self) -> u64
pub fn total_requests(&self) -> u64
Get total requests served
Sourcepub fn failed_requests(&self) -> u64
pub fn failed_requests(&self) -> u64
Get failed requests
Sourcepub fn error_rate(&self) -> f64
pub fn error_rate(&self) -> f64
Get error rate
Sourcepub fn time_since_last_check(&self) -> Duration
pub fn time_since_last_check(&self) -> Duration
Get time since last health check
Sourcepub fn report(&self) -> HealthReport
pub fn report(&self) -> HealthReport
Generate health report
Trait Implementations§
Source§impl Clone for ModelHealth
impl Clone for ModelHealth
Source§fn clone(&self) -> ModelHealth
fn clone(&self) -> ModelHealth
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ModelHealth
impl Debug for ModelHealth
Source§impl Default for ModelHealth
impl Default for ModelHealth
Source§fn default() -> ModelHealth
fn default() -> ModelHealth
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Forget for ModelHealth
impl Freeze for ModelHealth
impl Move for ModelHealth
impl RefUnwindSafe for ModelHealth
impl Send for ModelHealth
impl Sync for ModelHealth
impl Unpin for ModelHealth
impl UnsafeUnpin for ModelHealth
impl UnwindSafe for ModelHealth
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more