Struct UpDownCounter
#[non_exhaustive]pub struct UpDownCounter<T>(/* private fields */);
Available on crate feature
opentelemetry
only.Expand description
An instrument that records increasing or decreasing values.
UpDownCounter
can be cloned to create multiple handles to the same instrument. If a UpDownCounter
needs to be shared,
users are recommended to clone the UpDownCounter
instead of creating duplicate UpDownCounter
s for the same metric. Creating
duplicate UpDownCounter
s for the same metric could lower SDK performance.
Implementations§
§impl<T> UpDownCounter<T>
impl<T> UpDownCounter<T>
pub fn new(inner: Arc<dyn SyncInstrument<T> + Sync + Send>) -> UpDownCounter<T>
pub fn new(inner: Arc<dyn SyncInstrument<T> + Sync + Send>) -> UpDownCounter<T>
Create a new up down counter.
Trait Implementations§
§impl<T> Clone for UpDownCounter<T>where
T: Clone,
impl<T> Clone for UpDownCounter<T>where
T: Clone,
§fn clone(&self) -> UpDownCounter<T>
fn clone(&self) -> UpDownCounter<T>
Returns a copy 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 moreAuto Trait Implementations§
impl<T> Freeze for UpDownCounter<T>
impl<T> !RefUnwindSafe for UpDownCounter<T>
impl<T> Send for UpDownCounter<T>
impl<T> Sync for UpDownCounter<T>
impl<T> Unpin for UpDownCounter<T>
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