pub struct OperationMetrics { /* private fields */ }Expand description
Operation metrics using atomics
Implementations§
Source§impl OperationMetrics
impl OperationMetrics
Sourcepub fn record_operation(&self, duration_ns: u64, timestamp: u64, is_error: bool)
pub fn record_operation(&self, duration_ns: u64, timestamp: u64, is_error: bool)
Record a single operation execution with its duration and error status
Sourcepub fn snapshot(&self) -> OperationSnapshot
pub fn snapshot(&self) -> OperationSnapshot
Produce a serializable snapshot of the current operation metrics
Sourcepub fn is_problematic(&self) -> bool
pub fn is_problematic(&self) -> bool
Check whether this operation is exhibiting problematic performance
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for OperationMetrics
impl !RefUnwindSafe for OperationMetrics
impl Send for OperationMetrics
impl Sync for OperationMetrics
impl Unpin for OperationMetrics
impl UnsafeUnpin for OperationMetrics
impl UnwindSafe for OperationMetrics
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> 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> 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 moreSource§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::RequestSource§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