pub struct HistogramDuration { /* private fields */ }Expand description
A histogram that records Duration values, optionally tracking in memory for heartbeating.
Implementations§
Source§impl HistogramDuration
impl HistogramDuration
Sourcepub fn new(
inner: Arc<dyn MetricAttributable<Box<dyn HistogramDurationBase>> + Send + Sync>,
) -> Self
pub fn new( inner: Arc<dyn MetricAttributable<Box<dyn HistogramDurationBase>> + Send + Sync>, ) -> Self
Create a new duration histogram from an attributable metric source.
Sourcepub fn new_with_in_memory(
primary: Arc<dyn MetricAttributable<Box<dyn HistogramDurationBase>> + Send + Sync>,
in_memory: HeartbeatMetricType,
) -> Self
pub fn new_with_in_memory( primary: Arc<dyn MetricAttributable<Box<dyn HistogramDurationBase>> + Send + Sync>, in_memory: HeartbeatMetricType, ) -> Self
Create a new duration histogram with an additional in-memory tracker for heartbeat reporting.
Sourcepub fn record(&self, value: Duration, attributes: &MetricAttributes)
pub fn record(&self, value: Duration, attributes: &MetricAttributes)
Record a duration value with the given attributes.
Sourcepub fn update_attributes(&mut self, new_attributes: MetricAttributes)
pub fn update_attributes(&mut self, new_attributes: MetricAttributes)
Replace the attributes on the primary metric.
Trait Implementations§
Source§impl Clone for HistogramDuration
impl Clone for HistogramDuration
Source§fn clone(&self) -> HistogramDuration
fn clone(&self) -> HistogramDuration
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 MetricAttributable<HistogramDuration> for HistogramDuration
impl MetricAttributable<HistogramDuration> for HistogramDuration
Source§fn with_attributes(
&self,
attributes: &MetricAttributes,
) -> Result<HistogramDuration, Box<dyn Error>>
fn with_attributes( &self, attributes: &MetricAttributes, ) -> Result<HistogramDuration, Box<dyn Error>>
Replace any existing attributes on this metric with new ones, and return a new copy
of the metric, or a base version, which can be used to record values. Read more
Auto Trait Implementations§
impl !Freeze for HistogramDuration
impl !RefUnwindSafe for HistogramDuration
impl Send for HistogramDuration
impl Sync for HistogramDuration
impl Unpin for HistogramDuration
impl UnsafeUnpin for HistogramDuration
impl !UnwindSafe for HistogramDuration
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request