Skip to main content

MetricsExt

Trait MetricsExt 

Source
pub trait MetricsExt: Metrics {
    // Provided methods
    fn counter<N: Into<String>, H: Into<String>>(
        &self,
        name: N,
        help: H,
    ) -> Counter { ... }
    fn gauge<N: Into<String>, H: Into<String>>(&self, name: N, help: H) -> Gauge { ... }
    fn histogram<N: Into<String>, H: Into<String>, I>(
        &self,
        name: N,
        help: H,
        buckets: I,
    ) -> Histogram
       where I: IntoIterator<Item = f64> { ... }
    fn family<N, H, S, M>(&self, name: N, help: H) -> Registered<Family<S, M>>
       where N: Into<String>,
             H: Into<String>,
             S: Clone + Hash + Eq,
             M: Default,
             Family<S, M>: Metric { ... }
}
Expand description

One-line constructors for the common metric types.

Provided Methods§

Source

fn counter<N: Into<String>, H: Into<String>>(&self, name: N, help: H) -> Counter

Register a counter with the runtime.

Source

fn gauge<N: Into<String>, H: Into<String>>(&self, name: N, help: H) -> Gauge

Register a gauge with the runtime.

Source

fn histogram<N: Into<String>, H: Into<String>, I>( &self, name: N, help: H, buckets: I, ) -> Histogram
where I: IntoIterator<Item = f64>,

Register a histogram with the runtime.

Source

fn family<N, H, S, M>(&self, name: N, help: H) -> Registered<Family<S, M>>
where N: Into<String>, H: Into<String>, S: Clone + Hash + Eq, M: Default, Family<S, M>: Metric,

Register a metric family with the runtime.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§