pub struct DerivedHistogram<'a> { /* private fields */ }Expand description
A histogram that also updates one or more DerivedGauges.
The accessor that static_metrics generates for a histogram field with #[metric(derived(...))] returns this type.
Each recorded value goes to the histogram, then to each derived gauge.
Implementations§
Source§impl<'a> DerivedHistogram<'a>
impl<'a> DerivedHistogram<'a>
Sourcepub fn new(histogram: &'a Histogram, derived: &'a [DerivedGauge]) -> Self
pub fn new(histogram: &'a Histogram, derived: &'a [DerivedGauge]) -> Self
Creates a DerivedHistogram from a histogram and its derived gauges.
This is an implementation detail of the static_metrics attribute macro.
Sourcepub fn record<T: IntoF64>(&self, value: T)
pub fn record<T: IntoF64>(&self, value: T)
Records a value into the histogram, and updates the derived gauges.
Sourcepub fn record_many<T: IntoF64>(&self, value: T, count: usize)
pub fn record_many<T: IntoF64>(&self, value: T, count: usize)
Records a value into the histogram multiple times, and updates the derived gauges.
If count is zero, this method records nothing and leaves the derived gauges unchanged.
Trait Implementations§
Source§impl<'a> Clone for DerivedHistogram<'a>
impl<'a> Clone for DerivedHistogram<'a>
Source§fn clone(&self) -> DerivedHistogram<'a>
fn clone(&self) -> DerivedHistogram<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for DerivedHistogram<'a>
impl<'a> Debug for DerivedHistogram<'a>
impl<'a> Copy for DerivedHistogram<'a>
Auto Trait Implementations§
impl<'a> Freeze for DerivedHistogram<'a>
impl<'a> !RefUnwindSafe for DerivedHistogram<'a>
impl<'a> Send for DerivedHistogram<'a>
impl<'a> Sync for DerivedHistogram<'a>
impl<'a> Unpin for DerivedHistogram<'a>
impl<'a> UnsafeUnpin for DerivedHistogram<'a>
impl<'a> !UnwindSafe for DerivedHistogram<'a>
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