Struct metrix::instruments::other_instruments::LastOccurrenceTracker [−][src]
pub struct LastOccurrenceTracker { /* fields omitted */ }
Tracks how many seconds elapsed since the last occurence
Methods
impl LastOccurrenceTracker
[src]
impl LastOccurrenceTracker
pub fn new_with_defaults<T: Into<String>>(name: T) -> LastOccurrenceTracker
[src]
pub fn new_with_defaults<T: Into<String>>(name: T) -> LastOccurrenceTracker
pub fn name(&self) -> &str
[src]
pub fn name(&self) -> &str
Gets the name of this OccurenceTracker
pub fn set_name<T: Into<String>>(&mut self, name: T)
[src]
pub fn set_name<T: Into<String>>(&mut self, name: T)
Set the name if this OccurenceTracker
.
The name is a path segment within a Snapshot
pub fn set_title<T: Into<String>>(&mut self, title: T)
[src]
pub fn set_title<T: Into<String>>(&mut self, title: T)
Sets the title
of this OccurenceTracker
.
A title can be part of a descriptive Snapshot
pub fn set_description<T: Into<String>>(&mut self, description: T)
[src]
pub fn set_description<T: Into<String>>(&mut self, description: T)
Sets the description
of this OccurenceTracker
.
A description can be part of a descriptive Snapshot
pub fn set_invert(&mut self, invert: bool)
[src]
pub fn set_invert(&mut self, invert: bool)
Set whether the current value should be inverted in a snapshot or not
Default is false
pub fn enable_invert(&mut self)
[src]
pub fn enable_invert(&mut self)
The current value should be inverted in a snapshot
Same as self.set_invert(true);
pub fn set_make_none_zero(&mut self, make_zero: bool)
[src]
pub fn set_make_none_zero(&mut self, make_zero: bool)
If set to true
possible None
s that would
be returned will instead be 0
.
Hint: This instrument will return None
unless there
was at least one Occurence recorded.
pub fn make_none_zero(&self) -> bool
[src]
pub fn make_none_zero(&self) -> bool
return whether make_none_zero
is on or off
pub fn elapsed_since_last_occurrence(&self) -> Option<u64>
[src]
pub fn elapsed_since_last_occurrence(&self) -> Option<u64>
Returns the current state
Trait Implementations
impl Instrument for LastOccurrenceTracker
[src]
impl Instrument for LastOccurrenceTracker
impl PutsSnapshot for LastOccurrenceTracker
[src]
impl PutsSnapshot for LastOccurrenceTracker
fn put_snapshot(&self, into: &mut Snapshot, descriptive: bool)
[src]
fn put_snapshot(&self, into: &mut Snapshot, descriptive: bool)
Puts the current snapshot values into the given Snapshot
thereby following the guidelines of PutsSnapshot
. Read more
impl Updates for LastOccurrenceTracker
[src]
impl Updates for LastOccurrenceTracker
fn update(&mut self, _: &Update)
[src]
fn update(&mut self, _: &Update)
Update the internal state according to the given Update
. Read more
impl Descriptive for LastOccurrenceTracker
[src]
impl Descriptive for LastOccurrenceTracker
Auto Trait Implementations
impl Send for LastOccurrenceTracker
impl Send for LastOccurrenceTracker
impl Sync for LastOccurrenceTracker
impl Sync for LastOccurrenceTracker