pub struct VortexMetrics { /* private fields */ }
Expand description
A metric registry for various performance metrics.
Implementations§
Source§impl VortexMetrics
impl VortexMetrics
Sourcepub fn new(
registry: MetricRegistry,
default_tags: impl Into<DefaultTags>,
) -> Self
pub fn new( registry: MetricRegistry, default_tags: impl Into<DefaultTags>, ) -> Self
Create a new VortexMetrics
instance.
Create an empty metric registry with default tags.
Create a new metrics registry with additional tags. Metrics created in the child registry will be included in this registry’s snapshots.
Sourcepub fn counter<T>(&self, id: T) -> Arc<Counter>
pub fn counter<T>(&self, id: T) -> Arc<Counter>
Returns the counter with the specified ID, creating a default instance if absent.
§Panics
Panics if a metric is registered with the ID that is not a counter.
Sourcepub fn histogram<T>(&self, id: T) -> Arc<Histogram>
pub fn histogram<T>(&self, id: T) -> Arc<Histogram>
Returns the histogram with the specified ID, creating a default instance if absent.
§Panics
Panics if a metric is registered with the ID that is not a histogram.
Sourcepub fn timer<T>(&self, id: T) -> Arc<Timer>
pub fn timer<T>(&self, id: T) -> Arc<Timer>
Returns the timer with the specified ID, creating a default instance if absent.
§Panics
Panics if a metric is registered with the ID that is not a timer.
Sourcepub fn snapshot(&self) -> MetricsSnapshot
pub fn snapshot(&self) -> MetricsSnapshot
Returns a snapshot of the metrics in the registry.
Modifications to the registry after this method is called will not affect the state of the returned MetricsSnapshot
.
Note: Tag values may contain sensitive information and should be properly sanitized before external exposure.
Trait Implementations§
Source§impl Clone for VortexMetrics
impl Clone for VortexMetrics
Source§fn clone(&self) -> VortexMetrics
fn clone(&self) -> VortexMetrics
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more