Struct slog_extlog::stats::StatsTracker
source · pub struct StatsTracker { /* private fields */ }
Expand description
An object that tracks statistics and can be asked to log them
Implementations§
source§impl StatsTracker
impl StatsTracker
sourcepub fn add_statistic(
&mut self,
defn: &'static (dyn StatDefinition + Sync + RefUnwindSafe)
)
pub fn add_statistic( &mut self, defn: &'static (dyn StatDefinition + Sync + RefUnwindSafe) )
Add a new statistic to this tracker.
sourcepub fn log_all<T: StatisticsLogFormatter>(&self, logger: &StatisticsLogger)
pub fn log_all<T: StatisticsLogFormatter>(&self, logger: &StatisticsLogger)
Log all statistics.
This function is usually just called on a timer by the logger directly.
sourcepub fn get_stats(&self) -> Vec<StatSnapshot>
pub fn get_stats(&self) -> Vec<StatSnapshot>
Retrieve the current values of all stats tracked by this logger.
Trait Implementations§
source§impl Debug for StatsTracker
impl Debug for StatsTracker
source§impl Default for StatsTracker
impl Default for StatsTracker
source§fn default() -> StatsTracker
fn default() -> StatsTracker
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for StatsTracker
impl Send for StatsTracker
impl Sync for StatsTracker
impl Unpin for StatsTracker
impl UnwindSafe for StatsTracker
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more