pub struct InferenceMetrics {
pub total_steps: u64,
pub total_time_us: u64,
pub peak_latency_us: u64,
pub min_latency_us: u64,
/* private fields */
}Expand description
Performance metrics for inference operations
Fields§
§total_steps: u64Total number of inference steps
total_time_us: u64Total time spent in inference (microseconds)
peak_latency_us: u64Peak latency observed (microseconds)
min_latency_us: u64Minimum latency observed (microseconds)
Implementations§
Source§impl InferenceMetrics
impl InferenceMetrics
Sourcepub fn with_window_size(window_size: usize) -> Self
pub fn with_window_size(window_size: usize) -> Self
Create with custom window size for rolling statistics
Sourcepub fn record_step(&mut self, latency_us: u64)
pub fn record_step(&mut self, latency_us: u64)
Record a new inference step
Sourcepub fn avg_latency_us(&self) -> f64
pub fn avg_latency_us(&self) -> f64
Get average latency (microseconds)
Sourcepub fn recent_avg_latency_us(&self) -> f64
pub fn recent_avg_latency_us(&self) -> f64
Get recent average latency (microseconds)
Sourcepub fn throughput(&self) -> f64
pub fn throughput(&self) -> f64
Get throughput (steps per second)
Sourcepub fn percentiles(&self) -> (u64, u64, u64)
pub fn percentiles(&self) -> (u64, u64, u64)
Get p50, p95, p99 latencies (microseconds)
Sourcepub fn summary(&self) -> MetricsSummary
pub fn summary(&self) -> MetricsSummary
Get a summary report
Trait Implementations§
Source§impl Clone for InferenceMetrics
impl Clone for InferenceMetrics
Source§fn clone(&self) -> InferenceMetrics
fn clone(&self) -> InferenceMetrics
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 InferenceMetrics
impl Debug for InferenceMetrics
Auto Trait Implementations§
impl Freeze for InferenceMetrics
impl RefUnwindSafe for InferenceMetrics
impl Send for InferenceMetrics
impl Sync for InferenceMetrics
impl Unpin for InferenceMetrics
impl UnwindSafe for InferenceMetrics
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,
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