pub struct AggregateMetricRecorder { /* private fields */ }Expand description
Publishes aggregate-owned timing when dropped.
Create this before the operation that may return an error, and scope each
Self::timer to only the aggregate-owned work. All timed intervals are
combined into one metric update when the recorder is dropped.
Implementations§
Source§impl AggregateMetricRecorder
impl AggregateMetricRecorder
Sourcepub fn new(metric: Option<Arc<dyn AggregateMetric>>) -> Self
pub fn new(metric: Option<Arc<dyn AggregateMetric>>) -> Self
Creates a recorder for an optional aggregate-owned metric.
Sourcepub fn timer(&mut self) -> Option<AggregateMetricTimer<'_>>
pub fn timer(&mut self) -> Option<AggregateMetricTimer<'_>>
Starts timing one aggregate-owned interval.
Trait Implementations§
Source§impl Drop for AggregateMetricRecorder
impl Drop for AggregateMetricRecorder
Auto Trait Implementations§
impl Forget for AggregateMetricRecorder
impl Freeze for AggregateMetricRecorder
impl Move for AggregateMetricRecorder
impl RefUnwindSafe for AggregateMetricRecorder
impl Send for AggregateMetricRecorder
impl Sync for AggregateMetricRecorder
impl Unpin for AggregateMetricRecorder
impl UnsafeUnpin for AggregateMetricRecorder
impl UnwindSafe for AggregateMetricRecorder
Blanket Implementations§
impl<T> Allocation for T
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more