pub struct ValueRecorder<T>(/* private fields */);
Available on crate feature
metrics
only.Expand description
ValueRecorder is a metric that records per-request non-additive values.
Implementations§
Source§impl<T> ValueRecorder<T>
impl<T> ValueRecorder<T>
Sourcepub fn bind(&self, attributes: &[KeyValue]) -> BoundValueRecorder<T>
pub fn bind(&self, attributes: &[KeyValue]) -> BoundValueRecorder<T>
Creates a bound instrument for this ValueRecorder. 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
object to use with batch recording.
Trait Implementations§
Source§impl<T: Clone> Clone for ValueRecorder<T>
impl<T: Clone> Clone for ValueRecorder<T>
Source§fn clone(&self) -> ValueRecorder<T>
fn clone(&self) -> ValueRecorder<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 ValueRecorder<T>
impl<T> !RefUnwindSafe for ValueRecorder<T>
impl<T> Send for ValueRecorder<T>where
T: Send,
impl<T> Sync for ValueRecorder<T>where
T: Sync,
impl<T> Unpin for ValueRecorder<T>where
T: Unpin,
impl<T> !UnwindSafe for ValueRecorder<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.