Struct slog_extlog::stats::StatsConfig
[−]
[src]
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 reactor core 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]
T: StatisticsLogFormatter,
fn fmt(&self, __arg_0: &mut Formatter) -> Result[src]
Formats the value using the given formatter. Read more
impl<F> Default for StatsConfig<F> where
F: StatisticsLogFormatter, [src]
F: StatisticsLogFormatter,