[][src]Struct slog_extlog::stats::StatsConfig

pub struct StatsConfig<T> where
    T: StatisticsLogFormatter
{ pub interval_secs: Option<u64>, pub stats: Vec<StatDefinitions>, pub handle: Option<Handle>, pub stat_formatter: PhantomData<T>, }

Configuration required for tracking statistics.

This configuration should be passed to a StatisticsLogger to allow tracking metrics from logs.

Construct either with Default::default() for no stats at all, or else use a StatsConfigBuilder.

Fields

interval_secs: Option<u64>

The period, in seconds, to log the generated metrics into the log stream. Defaults to 300 seconds (5 minutes). One log will be generated for each metric value. A value of None indicates stats should never be logged.

stats: Vec<StatDefinitions>

The list of statistics to track. This MUST be created using the define_stats macro.

handle: Option<Handle>

The tokio runtime to run the stats logging on, if the user is using tokio already. If this is None (the default), then a new core is created for logging stats.

stat_formatter: PhantomData<T>

An object that handles formatting the individual statistic values into a log.

Trait Implementations

impl<T: Debug> Debug for StatsConfig<T> where
    T: StatisticsLogFormatter
[src]

impl<F> Default for StatsConfig<F> where
    F: StatisticsLogFormatter
[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for StatsConfig<T>

impl<T> Send for StatsConfig<T> where
    T: Send

impl<T> Sync for StatsConfig<T> where
    T: Sync

impl<T> Unpin for StatsConfig<T> where
    T: Unpin

impl<T> !UnwindSafe for StatsConfig<T>

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.