pub struct UpDownCounter<T>(/* private fields */);
Available on crate feature
metrics
only.Expand description
A metric instrument that sums non-monotonic values.
Implementations§
Source§impl<T> UpDownCounter<T>
impl<T> UpDownCounter<T>
Sourcepub fn bind(&self, attributes: &[KeyValue]) -> BoundUpDownCounter<T>
pub fn bind(&self, attributes: &[KeyValue]) -> BoundUpDownCounter<T>
Creates a bound instrument for this counter. The attributes are associated with values recorded via subsequent calls to record.
Sourcepub fn measurement(&self, value: T) -> Measurement
pub fn measurement(&self, value: T) -> Measurement
Creates a Measurement for use with batch recording.
Trait Implementations§
Source§impl<T: Clone> Clone for UpDownCounter<T>
impl<T: Clone> Clone for UpDownCounter<T>
Source§fn clone(&self) -> UpDownCounter<T>
fn clone(&self) -> UpDownCounter<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<T> Freeze for UpDownCounter<T>
impl<T> !RefUnwindSafe for UpDownCounter<T>
impl<T> Send for UpDownCounter<T>where
T: Send,
impl<T> Sync for UpDownCounter<T>where
T: Sync,
impl<T> Unpin for UpDownCounter<T>where
T: Unpin,
impl<T> !UnwindSafe for UpDownCounter<T>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Available on crate feature
trace
only.Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Available on crate feature
trace
only.