[][src]Struct prometrics::metrics::MetricBuilder

pub struct MetricBuilder { /* fields omitted */ }

Common builder for various metrics.

Methods

impl MetricBuilder[src]

pub fn new() -> Self[src]

Makes a builder with the default registry.

pub fn with_registry(registry: Registry) -> Self[src]

Makes a builder with the given registry.

pub fn without_registry() -> Self[src]

Makes a builder without any registries.

pub fn namespace(&mut self, namespace: &str) -> &mut Self[src]

Sets the namespace part of the metric name.

pub fn subsystem(&mut self, subsystem: &str) -> &mut Self[src]

Sets the subsystem part of the metric name of this.

pub fn label(&mut self, name: &str, value: &str) -> &mut Self[src]

Adds a label.

Note that name will be validated when creating the metrics.

pub fn registry(&mut self, registry: Registry) -> &mut Self[src]

Adds a registry to which the resulting metrics will be registered.

pub fn set_registry(&mut self, registry: Registry) -> &mut Self[src]

Clears the current registries, then sets registry as the new one.

pub fn counter(&self, name: &str) -> CounterBuilder[src]

Makes a CounterBuilder that inherited the setting of this builder.

pub fn gauge(&self, name: &str) -> GaugeBuilder[src]

Makes a GaugeBuilder that inherited the setting of this builder.

pub fn histogram(&self, name: &str) -> HistogramBuilder[src]

Makes a HistogramBuilder that inherited the setting of this builder.

pub fn summary(&self, name: &str, window: Duration) -> SummaryBuilder[src]

Makes a SummaryBuilder that inherited the setting of this builder.

Trait Implementations

impl Clone for MetricBuilder[src]

impl Debug for MetricBuilder[src]

impl Default for MetricBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.