[][src]Struct spirit_dipstick::Config

pub struct Config {
    pub prefix: String,
    pub flush_period: Duration,
    // some fields omitted
}

The Fragment to configure dipsticks backends.

This contains the configuration options to configure where the metrics go.

If you want to be able to turn the metrics off completely, use Option<Config>.

Some of the fields are publicly available and accessible, as they might be useful for other purposes ‒ like generating some metrics at the same frequency as they are being sent.

Examples

use serde::Deserialize;
use spirit_dipstick::Config;

#[derive(Default, Deserialize)]
struct Cfg {
    metrics: Config,
}

Fields

prefix: String

The prefix ‒ first level of the metrics tree, under which all the metrics are stored.

If not specifie, it defaults to the application name.

flush_period: Duration

An interval at which the metrics are sent in aggregated form.

The metrics are not sent right away, they are buffered and collated for this period of time, then they are sent in a batch.

Trait Implementations

impl Clone for Config[src]

impl Debug for Config[src]

impl Default for Config[src]

impl<'de> Deserialize<'de> for Config[src]

impl Eq for Config[src]

impl Fragment for Config[src]

type Driver = CacheEq<Config>

The default driver to be used by the fragment. Read more

type Installer = ()

The default installer to be used unless a transformation or the user doesn't provide one. Read more

type Seed = ()

The intermediate product if the fragment supports two-stage creation of [Resource][Fragment::Resource]s. If not, it can be set to (). Read more

type Resource = Backends

The actual product this [Fragment] creates.

impl Optional for Config[src]

impl PartialEq<Config> for Config[src]

impl Serialize for Config[src]

impl StructDoc for Config[src]

impl StructuralEq for Config[src]

impl StructuralPartialEq for Config[src]

Auto Trait Implementations

impl RefUnwindSafe for Config

impl Send for Config

impl Sync for Config

impl Unpin for Config

impl UnwindSafe for Config

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

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

impl<F> Optional for F where
    F: Stackable
[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.