pub struct WindowSnapshot {
pub successes: u64,
pub failures: u64,
pub drops: u64,
pub latency_sum: Duration,
pub latency_samples: u64,
}Expand description
Aggregated view over the live buckets in a rolling window.
Fields§
§successes: u64Successful operation count.
failures: u64Failed operation count.
drops: u64Dropped operation count.
latency_sum: DurationSum of recorded successful latencies.
latency_samples: u64Number of samples contributing to Self::latency_sum.
Implementations§
Source§impl WindowSnapshot
impl WindowSnapshot
Sourcepub fn failure_ratio(&self) -> f64
pub fn failure_ratio(&self) -> f64
Failure ratio in the range [0.0, 1.0].
Sourcepub fn drop_ratio(&self) -> f64
pub fn drop_ratio(&self) -> f64
Drop ratio in the range [0.0, 1.0].
Sourcepub fn average_latency(&self) -> Option<Duration>
pub fn average_latency(&self) -> Option<Duration>
Average latency for samples recorded with latency.
Trait Implementations§
Source§impl Clone for WindowSnapshot
impl Clone for WindowSnapshot
Source§fn clone(&self) -> WindowSnapshot
fn clone(&self) -> WindowSnapshot
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WindowSnapshot
impl Debug for WindowSnapshot
Source§impl Default for WindowSnapshot
impl Default for WindowSnapshot
Source§fn default() -> WindowSnapshot
fn default() -> WindowSnapshot
Returns the “default value” for a type. Read more
Source§impl PartialEq for WindowSnapshot
impl PartialEq for WindowSnapshot
Source§fn eq(&self, other: &WindowSnapshot) -> bool
fn eq(&self, other: &WindowSnapshot) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for WindowSnapshot
impl StructuralPartialEq for WindowSnapshot
Auto Trait Implementations§
impl Freeze for WindowSnapshot
impl RefUnwindSafe for WindowSnapshot
impl Send for WindowSnapshot
impl Sync for WindowSnapshot
impl Unpin for WindowSnapshot
impl UnsafeUnpin for WindowSnapshot
impl UnwindSafe for WindowSnapshot
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> 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::Request