pub struct ProviderMetrics { /* private fields */ }Expand description
Thread-safe metrics accumulator for a single provider registration.
Implementations§
Source§impl ProviderMetrics
impl ProviderMetrics
Sourcepub fn record_hit(&self, stale: bool)
pub fn record_hit(&self, stale: bool)
Record a hit outcome.
Sourcepub fn record_miss(&self)
pub fn record_miss(&self)
Record a miss outcome.
Sourcepub fn record_refresh_success(&self, duration: Duration)
pub fn record_refresh_success(&self, duration: Duration)
Record a successful refresh and latency.
Sourcepub fn record_refresh_error(&self)
pub fn record_refresh_error(&self)
Record refresh failure.
Sourcepub fn snapshot(&self) -> ProviderMetricsSnapshot
pub fn snapshot(&self) -> ProviderMetricsSnapshot
Take a point-in-time snapshot for status reporting.
Trait Implementations§
Source§impl Debug for ProviderMetrics
impl Debug for ProviderMetrics
Source§impl Default for ProviderMetrics
impl Default for ProviderMetrics
Source§fn default() -> ProviderMetrics
fn default() -> ProviderMetrics
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for ProviderMetrics
impl RefUnwindSafe for ProviderMetrics
impl Send for ProviderMetrics
impl Sync for ProviderMetrics
impl Unpin for ProviderMetrics
impl UnwindSafe for ProviderMetrics
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