pub struct MetricsRegistry { /* private fields */ }
Expand description
Metrics registry for managing all metrics
Implementations§
Source§impl MetricsRegistry
impl MetricsRegistry
Sourcepub fn register<T>(&self, name: String, metric: T) -> CoreResult<()>
pub fn register<T>(&self, name: String, metric: T) -> CoreResult<()>
Register a metric
Sourcepub fn get_all_metrics(&self) -> CoreResult<Vec<MetricPoint>>
pub fn get_all_metrics(&self) -> CoreResult<Vec<MetricPoint>>
Get all metric points
Sourcepub fn export_prometheus(&self) -> CoreResult<String>
pub fn export_prometheus(&self) -> CoreResult<String>
Export metrics in Prometheus format
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 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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more