pub struct MetricsRegistry { /* private fields */ }Expand description
Metrics registry for named metrics.
Provides a centralized registry for counters and histograms.
Uses Arc for safe shared access without raw pointers.
Implementations§
Source§impl MetricsRegistry
impl MetricsRegistry
Sourcepub fn counter(&self, name: &'static str) -> Arc<Counter>
pub fn counter(&self, name: &'static str) -> Arc<Counter>
Get or create a counter by name.
Returns an Arc<Counter> that can be used to update the counter.
Sourcepub fn histogram(&self, name: &'static str) -> Arc<Histogram>
pub fn histogram(&self, name: &'static str) -> Arc<Histogram>
Get or create a histogram by name.
Sourcepub fn snapshot(&self) -> MetricsSnapshot
pub fn snapshot(&self) -> MetricsSnapshot
Take a snapshot of all metrics.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for MetricsRegistry
impl !RefUnwindSafe for MetricsRegistry
impl Send for MetricsRegistry
impl Sync for MetricsRegistry
impl Unpin for MetricsRegistry
impl UnsafeUnpin for MetricsRegistry
impl UnwindSafe for MetricsRegistry
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