pub struct MetricsCollector { /* private fields */ }Expand description
Collector for streaming metrics.
Implementations§
Source§impl MetricsCollector
impl MetricsCollector
Sourcepub async fn is_enabled(&self) -> bool
pub async fn is_enabled(&self) -> bool
Check if enabled.
Sourcepub async fn increment_counter(&self, name: &str, value: i64) -> Result<()>
pub async fn increment_counter(&self, name: &str, value: i64) -> Result<()>
Increment a counter.
Sourcepub async fn record_histogram(
&self,
name: &str,
value: f64,
buckets: Vec<f64>,
) -> Result<()>
pub async fn record_histogram( &self, name: &str, value: f64, buckets: Vec<f64>, ) -> Result<()>
Record a histogram value.
Sourcepub async fn get_metric(&self, name: &str) -> Option<Metric>
pub async fn get_metric(&self, name: &str) -> Option<Metric>
Get a metric by name.
Sourcepub async fn get_all_metrics(&self) -> Vec<Metric>
pub async fn get_all_metrics(&self) -> Vec<Metric>
Get all metrics.
Sourcepub async fn metric_count(&self) -> usize
pub async fn metric_count(&self) -> usize
Get metric count.
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