pub struct RequestRateAggregator { /* private fields */ }Expand description
Aggregator over the most recent window per-request snapshots.
Thread-safe via an internal mutex.
Implementations§
Source§impl RequestRateAggregator
impl RequestRateAggregator
Sourcepub fn with_window(window: usize) -> Self
pub fn with_window(window: usize) -> Self
Create an aggregator with a custom window size (clamped to >= 1).
Sourcepub fn record(&self, snap: RequestRateSnapshot)
pub fn record(&self, snap: RequestRateSnapshot)
Record a completed request’s snapshot.
Sourcepub fn snapshot(&self) -> AggregateRateSnapshot
pub fn snapshot(&self) -> AggregateRateSnapshot
Compute the workload-level snapshot from the current window.
Trait Implementations§
Source§impl Debug for RequestRateAggregator
impl Debug for RequestRateAggregator
Auto Trait Implementations§
impl !Freeze for RequestRateAggregator
impl RefUnwindSafe for RequestRateAggregator
impl Send for RequestRateAggregator
impl Sync for RequestRateAggregator
impl Unpin for RequestRateAggregator
impl UnsafeUnpin for RequestRateAggregator
impl UnwindSafe for RequestRateAggregator
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 more