pub struct RuntimeMetrics { /* private fields */ }Expand description
Runtime metrics collector.
Tracks operation counts, timing data, and cache statistics.
Implementations§
Source§impl RuntimeMetrics
impl RuntimeMetrics
Sourcepub fn record(&self, kind: MetricKind)
pub fn record(&self, kind: MetricKind)
Records a metric occurrence.
Sourcepub fn record_timing(&self, kind: MetricKind, duration: Duration)
pub fn record_timing(&self, kind: MetricKind, duration: Duration)
Records a timed operation.
Sourcepub fn record_cache_access(&self, hit: bool)
pub fn record_cache_access(&self, hit: bool)
Records a cache access.
Sourcepub fn count(&self, kind: MetricKind) -> u64
pub fn count(&self, kind: MetricKind) -> u64
Gets the count for a specific metric.
Sourcepub fn total_time(&self) -> Duration
pub fn total_time(&self) -> Duration
Gets the total operation time.
Sourcepub fn cache_hit_rate(&self) -> f64
pub fn cache_hit_rate(&self) -> f64
Gets the cache hit rate (0.0 to 1.0).
Sourcepub fn summary(&self) -> MetricsSummary
pub fn summary(&self) -> MetricsSummary
Gets all metrics as a summary.
Trait Implementations§
Source§impl Clone for RuntimeMetrics
impl Clone for RuntimeMetrics
Source§fn clone(&self) -> RuntimeMetrics
fn clone(&self) -> RuntimeMetrics
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 RuntimeMetrics
impl Debug for RuntimeMetrics
Auto Trait Implementations§
impl Freeze for RuntimeMetrics
impl RefUnwindSafe for RuntimeMetrics
impl Send for RuntimeMetrics
impl Sync for RuntimeMetrics
impl Unpin for RuntimeMetrics
impl UnsafeUnpin for RuntimeMetrics
impl UnwindSafe for RuntimeMetrics
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
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,
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