[][src]Struct prometrics::metrics::HistogramBuilder

pub struct HistogramBuilder { /* fields omitted */ }

Histogram builder.

Methods

impl HistogramBuilder[src]

pub fn new(name: &str) -> Self[src]

Makes a builder for histograms named name.

pub fn with_linear_buckets(
    name: &str,
    start: f64,
    width: f64,
    count: usize
) -> Self
[src]

Makes a builder with the specified linear buckets.

pub fn with_exponential_buckets(
    name: &str,
    start: f64,
    factor: f64,
    count: usize
) -> Self
[src]

Makes a builder with the specified exponential buckets.

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

Sets the namespace part of the metric name of this.

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

Sets the subsystem part of the metric name of this.

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

Sets the help of this.

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

Adds a label.

Note that name will be validated in the invocation of the finish method.

The name "le" is reserved for designating buckets.

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

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

pub fn default_registry(&mut self) -> &mut Self[src]

Adds the default registry.

pub fn bucket(&mut self, upper_bound: f64) -> &mut Self[src]

Adds a bucket.

pub fn buckets<I: IntoIterator<Item = f64>>(
    &mut self,
    upper_bounds: I
) -> &mut Self
[src]

Adds a sequence of buckets.

pub fn finish(&self) -> Result<Histogram>[src]

Builds a histogram.

Errors

This method will return Err(_) if one of the following conditions is satisfied:

  • Any of the name of the metric or labels is malformed
  • There is a bucket whose upper bound is NaN

Trait Implementations

impl Debug for HistogramBuilder[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, 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.