#[repr(align(64))]pub struct Registry { /* private fields */ }
Expand description
A thread-safe registry for storing metrics by name.
Uses RwLock for simplicity while maintaining good performance for the read-heavy workloads typical in metrics collection.
Implementations§
Source§impl Registry
impl Registry
Sourcepub fn get_or_create_counter(&self, name: &str) -> Arc<Counter>
pub fn get_or_create_counter(&self, name: &str) -> Arc<Counter>
Get or create a counter by name.
Sourcepub fn get_or_create_gauge(&self, name: &str) -> Arc<Gauge>
pub fn get_or_create_gauge(&self, name: &str) -> Arc<Gauge>
Get or create a gauge by name.
Sourcepub fn get_or_create_timer(&self, name: &str) -> Arc<Timer>
pub fn get_or_create_timer(&self, name: &str) -> Arc<Timer>
Get or create a timer by name.
Sourcepub fn get_or_create_rate_meter(&self, name: &str) -> Arc<RateMeter>
pub fn get_or_create_rate_meter(&self, name: &str) -> Arc<RateMeter>
Get or create a rate meter by name.
Sourcepub fn counter_names(&self) -> Vec<String>
pub fn counter_names(&self) -> Vec<String>
Get all registered counter names.
Sourcepub fn gauge_names(&self) -> Vec<String>
pub fn gauge_names(&self) -> Vec<String>
Get all registered gauge names.
Sourcepub fn timer_names(&self) -> Vec<String>
pub fn timer_names(&self) -> Vec<String>
Get all registered timer names.
Sourcepub fn rate_meter_names(&self) -> Vec<String>
pub fn rate_meter_names(&self) -> Vec<String>
Get all registered rate meter names.
Sourcepub fn metric_count(&self) -> usize
pub fn metric_count(&self) -> usize
Get total number of registered metrics.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Registry
impl RefUnwindSafe for Registry
impl Send for Registry
impl Sync for Registry
impl Unpin for Registry
impl UnwindSafe for Registry
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