[−][src]Struct metrix::instruments::other_instruments::LastOccurrenceTracker
Tracks how many seconds elapsed since the last occurrence
Methods
impl LastOccurrenceTracker
[src]
pub fn new<T: Into<String>>(name: T) -> LastOccurrenceTracker
[src]
pub fn new_with_defaults<T: Into<String>>(name: T) -> LastOccurrenceTracker
[src]
pub fn get_name(&self) -> &str
[src]
pub fn set_name<T: Into<String>>(&mut self, name: T)
[src]
pub fn name<T: Into<String>>(self, name: T) -> Self
[src]
pub fn set_title<T: Into<String>>(&mut self, title: T)
[src]
pub fn title<T: Into<String>>(self, title: T) -> Self
[src]
pub fn set_description<T: Into<String>>(&mut self, description: T)
[src]
pub fn description<T: Into<String>>(self, description: T) -> Self
[src]
pub fn set_invert_enabled(&mut self, invert: bool)
[src]
Set whether the current value should be inverted in a snapshot or not
Default is false
pub fn invert_enabled(self, invert: bool) -> Self
[src]
Set whether the current value should be inverted in a snapshot or not
Default is false
pub fn inverted(self) -> Self
[src]
The current value should be inverted in a snapshot
Same as self.set_invert(true);
pub fn is_inverted(&self) -> bool
[src]
return whether invert is on or off
pub fn set_make_none_zero(&mut self, make_zero: bool)
[src]
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 occurrence recorded.
pub fn make_none_zero(self, make_zero: bool) -> Self
[src]
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 occurrence recorded.
pub fn get_make_none_zero(&self) -> bool
[src]
return whether make_none_zero
is on or off
pub fn accept<L: Eq + Send + 'static, F: Into<LabelFilter<L>>>(
self,
accept: F
) -> InstrumentAdapter<L, Self>
[src]
self,
accept: F
) -> InstrumentAdapter<L, Self>
pub fn for_label<L: Eq + Send + 'static>(
self,
label: L
) -> InstrumentAdapter<L, Self>
[src]
self,
label: L
) -> InstrumentAdapter<L, Self>
Creates an InstrumentAdapter
that makes this instrument
react on observations on the given label.
pub fn for_labels<L: Eq + Send + 'static>(
self,
labels: Vec<L>
) -> InstrumentAdapter<L, Self>
[src]
self,
labels: Vec<L>
) -> InstrumentAdapter<L, Self>
Creates an InstrumentAdapter
that makes this instrument
react on observations with the given labels.
If labels
is empty the instrument will not react to any observations
pub fn for_all_labels<L: Eq + Send + 'static>(
self
) -> InstrumentAdapter<L, Self>
[src]
self
) -> InstrumentAdapter<L, Self>
Creates an InstrumentAdapter
that makes this instrument react on
all observations.
pub fn for_labels_by_predicate<L, P>(
self,
label_predicate: P
) -> InstrumentAdapter<L, Self> where
L: Eq + Send + 'static,
P: Fn(&L) -> bool + Send + 'static,
[src]
self,
label_predicate: P
) -> InstrumentAdapter<L, Self> where
L: Eq + Send + 'static,
P: Fn(&L) -> bool + Send + 'static,
Creates an InstrumentAdapter
that makes this instrument react on
observations with labels specified by the predicate.
pub fn adapter<L: Eq + Send + 'static>(self) -> InstrumentAdapter<L, Self>
[src]
Creates an InstrumentAdapter
that makes this instrument to no
observations.
Trait Implementations
impl Descriptive for LastOccurrenceTracker
[src]
impl Instrument for LastOccurrenceTracker
[src]
impl PutsSnapshot for LastOccurrenceTracker
[src]
fn put_snapshot(&self, into: &mut Snapshot, descriptive: bool)
[src]
impl Updates for LastOccurrenceTracker
[src]
Auto Trait Implementations
impl RefUnwindSafe for LastOccurrenceTracker
impl Send for LastOccurrenceTracker
impl Sync for LastOccurrenceTracker
impl Unpin for LastOccurrenceTracker
impl UnwindSafe for LastOccurrenceTracker
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,