[][src]Struct metrics_runtime::Builder

pub struct Builder { /* fields omitted */ }

Builder for Receiver.

Implementations

impl Builder[src]

pub fn new() -> Self[src]

Creates a new Builder with default values.

pub fn histogram(self, window: Duration, granularity: Duration) -> Self[src]

Sets the histogram configuration.

Defaults to a 10 second window with 1 second granularity.

This controls both how long of a time window we track histogram data for, and the granularity in which we roll off old data.

As an example, with the default values, we would keep the last 10 seconds worth of histogram data, and would remove 1 seconds worth of data at a time as the window rolled forward.

pub fn upkeep_interval(self, interval: Duration) -> Self[src]

Sets the upkeep interval.

Defaults to 50 milliseconds.

This controls how often the time source, used internally by histograms, is updated with the real time. For performance reasons, histograms use a sampled time source when they perform checks to see if internal maintenance needs to occur. If the histogram granularity is set very low, then this interval might need to be similarly reduced to make sure we're able to update the time more often than histograms need to perform upkeep.

pub fn build(self) -> Result<Receiver, BuilderError>[src]

Create a Receiver based on this configuration.

Trait Implementations

impl Clone for Builder[src]

impl Default for Builder[src]

Auto Trait Implementations

impl RefUnwindSafe for Builder

impl Send for Builder

impl Sync for Builder

impl Unpin for Builder

impl UnwindSafe for Builder

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> Same<T> for T

type Output = T

Should always be Self

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.