pub struct MetricsCollector { /* private fields */ }Expand description
Central metrics collector that manages all metrics
Implementations§
Source§impl MetricsCollector
impl MetricsCollector
Sourcepub fn create_counter(
&self,
name: impl Into<String>,
help: impl Into<String>,
) -> Arc<Counter>
pub fn create_counter( &self, name: impl Into<String>, help: impl Into<String>, ) -> Arc<Counter>
Create a new counter
Sourcepub fn create_gauge(
&self,
name: impl Into<String>,
help: impl Into<String>,
) -> Arc<Gauge>
pub fn create_gauge( &self, name: impl Into<String>, help: impl Into<String>, ) -> Arc<Gauge>
Create a new gauge
Sourcepub fn create_histogram(
&self,
name: impl Into<String>,
help: impl Into<String>,
) -> Arc<Histogram>
pub fn create_histogram( &self, name: impl Into<String>, help: impl Into<String>, ) -> Arc<Histogram>
Create a new histogram
Sourcepub fn all_counters(&self) -> Vec<Arc<Counter>>
pub fn all_counters(&self) -> Vec<Arc<Counter>>
Get all counters
Sourcepub fn all_gauges(&self) -> Vec<Arc<Gauge>>
pub fn all_gauges(&self) -> Vec<Arc<Gauge>>
Get all gauges
Sourcepub fn all_histograms(&self) -> Vec<Arc<Histogram>>
pub fn all_histograms(&self) -> Vec<Arc<Histogram>>
Get all histograms
Sourcepub fn remove_counter(&self, name: &str) -> bool
pub fn remove_counter(&self, name: &str) -> bool
Remove a counter by name
Sourcepub fn remove_gauge(&self, name: &str) -> bool
pub fn remove_gauge(&self, name: &str) -> bool
Remove a gauge by name
Sourcepub fn remove_histogram(&self, name: &str) -> bool
pub fn remove_histogram(&self, name: &str) -> bool
Remove a histogram by name
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for MetricsCollector
impl RefUnwindSafe for MetricsCollector
impl Send for MetricsCollector
impl Sync for MetricsCollector
impl Unpin for MetricsCollector
impl UnsafeUnpin for MetricsCollector
impl UnwindSafe for MetricsCollector
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