pub struct EngineStats {
pub total_tokens_generated: AtomicU64,
pub total_requests: AtomicU64,
pub active_sessions: AtomicUsize,
pub start_time: Instant,
}Expand description
Statistics about engine usage, accumulated over the engine’s lifetime.
Fields§
§total_tokens_generated: AtomicU64Total number of tokens generated.
total_requests: AtomicU64Total number of inference requests completed.
active_sessions: AtomicUsizeNumber of currently active sessions.
start_time: InstantEngine start time.
Implementations§
Source§impl EngineStats
impl EngineStats
Sourcepub fn uptime_seconds(&self) -> f64
pub fn uptime_seconds(&self) -> f64
Engine uptime in seconds.
Sourcepub fn record_request(&self, tokens_generated: usize)
pub fn record_request(&self, tokens_generated: usize)
Record that a request completed with the given number of generated tokens.
Sourcepub fn tokens_generated(&self) -> u64
pub fn tokens_generated(&self) -> u64
Get total tokens generated.
Sourcepub fn requests_completed(&self) -> u64
pub fn requests_completed(&self) -> u64
Get total requests completed.
Sourcepub fn active_session_count(&self) -> usize
pub fn active_session_count(&self) -> usize
Get number of active sessions.
Sourcepub fn avg_tokens_per_request(&self) -> f64
pub fn avg_tokens_per_request(&self) -> f64
Average tokens per request (returns 0.0 if no requests).
Trait Implementations§
Source§impl Debug for EngineStats
impl Debug for EngineStats
Auto Trait Implementations§
impl !Freeze for EngineStats
impl RefUnwindSafe for EngineStats
impl Send for EngineStats
impl Sync for EngineStats
impl Unpin for EngineStats
impl UnsafeUnpin for EngineStats
impl UnwindSafe for EngineStats
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