pub struct ModelInstance {
pub id: String,
pub weight: f64,
pub active_requests: usize,
pub total_requests: u64,
pub total_processing_time: Duration,
pub last_health_check: Instant,
pub is_healthy: bool,
}Expand description
Model instance for serving
Fields§
§id: String§weight: f64§active_requests: usize§total_requests: u64§total_processing_time: Duration§last_health_check: Instant§is_healthy: boolImplementations§
Source§impl ModelInstance
impl ModelInstance
Sourcepub fn update_stats(&mut self, processing_time: Duration)
pub fn update_stats(&mut self, processing_time: Duration)
Update instance statistics after processing a request
Sourcepub fn average_response_time(&self) -> Duration
pub fn average_response_time(&self) -> Duration
Get average response time
Sourcepub fn start_request(&mut self)
pub fn start_request(&mut self)
Mark request as started
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ModelInstance
impl RefUnwindSafe for ModelInstance
impl Send for ModelInstance
impl Sync for ModelInstance
impl Unpin for ModelInstance
impl UnsafeUnpin for ModelInstance
impl UnwindSafe for ModelInstance
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> 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