Struct opentelemetry::metrics::ObservableUpDownCounter
source · pub struct ObservableUpDownCounter<T>(/* private fields */);
Expand description
An async instrument that records increasing or decreasing values.
Implementations§
source§impl<T> ObservableUpDownCounter<T>
impl<T> ObservableUpDownCounter<T>
sourcepub fn new(inner: Arc<dyn AsyncInstrument<T>>) -> Self
pub fn new(inner: Arc<dyn AsyncInstrument<T>>) -> Self
Create a new observable up down counter.
sourcepub fn observe(&self, value: T, attributes: &[KeyValue])
pub fn observe(&self, value: T, attributes: &[KeyValue])
Records the increment or decrement to the counter.
It is only valid to call this within a callback. If called outside of the registered callback it should have no effect on the instrument, and an error will be reported via the error handler.
Trait Implementations§
source§impl<T> AsyncInstrument<T> for ObservableUpDownCounter<T>
impl<T> AsyncInstrument<T> for ObservableUpDownCounter<T>
source§impl<T: Clone> Clone for ObservableUpDownCounter<T>
impl<T: Clone> Clone for ObservableUpDownCounter<T>
source§fn clone(&self) -> ObservableUpDownCounter<T>
fn clone(&self) -> ObservableUpDownCounter<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 moresource§impl<T> Debug for ObservableUpDownCounter<T>where
T: Debug,
impl<T> Debug for ObservableUpDownCounter<T>where
T: Debug,
source§impl TryFrom<AsyncInstrumentBuilder<'_, ObservableUpDownCounter<f64>, f64>> for ObservableUpDownCounter<f64>
impl TryFrom<AsyncInstrumentBuilder<'_, ObservableUpDownCounter<f64>, f64>> for ObservableUpDownCounter<f64>
source§type Error = MetricsError
type Error = MetricsError
The type returned in the event of a conversion error.
source§fn try_from(
builder: AsyncInstrumentBuilder<'_, ObservableUpDownCounter<f64>, f64>,
) -> Result<Self, Self::Error>
fn try_from( builder: AsyncInstrumentBuilder<'_, ObservableUpDownCounter<f64>, f64>, ) -> Result<Self, Self::Error>
Performs the conversion.
source§impl TryFrom<AsyncInstrumentBuilder<'_, ObservableUpDownCounter<i64>, i64>> for ObservableUpDownCounter<i64>
impl TryFrom<AsyncInstrumentBuilder<'_, ObservableUpDownCounter<i64>, i64>> for ObservableUpDownCounter<i64>
source§type Error = MetricsError
type Error = MetricsError
The type returned in the event of a conversion error.
source§fn try_from(
builder: AsyncInstrumentBuilder<'_, ObservableUpDownCounter<i64>, i64>,
) -> Result<Self, Self::Error>
fn try_from( builder: AsyncInstrumentBuilder<'_, ObservableUpDownCounter<i64>, i64>, ) -> Result<Self, Self::Error>
Performs the conversion.
Auto Trait Implementations§
impl<T> Freeze for ObservableUpDownCounter<T>
impl<T> !RefUnwindSafe for ObservableUpDownCounter<T>
impl<T> Send for ObservableUpDownCounter<T>
impl<T> Sync for ObservableUpDownCounter<T>
impl<T> Unpin for ObservableUpDownCounter<T>
impl<T> !UnwindSafe for ObservableUpDownCounter<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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)