pub struct ThroughputTracker { /* private fields */ }Expand description
Throughput tracker.
Implementations§
Source§impl ThroughputTracker
impl ThroughputTracker
Sourcepub fn new(interval_duration: Duration, max_intervals: usize) -> Self
pub fn new(interval_duration: Duration, max_intervals: usize) -> Self
Create a new throughput tracker.
Sourcepub async fn record_elements(&self, count: u64)
pub async fn record_elements(&self, count: u64)
Record elements processed.
Sourcepub async fn record_bytes(&self, bytes: u64)
pub async fn record_bytes(&self, bytes: u64)
Record bytes processed.
Sourcepub async fn elements_per_second(&self) -> f64
pub async fn elements_per_second(&self) -> f64
Get the overall throughput (elements per second).
Sourcepub async fn bytes_per_second(&self) -> f64
pub async fn bytes_per_second(&self) -> f64
Get the overall throughput (bytes per second).
Sourcepub async fn average_elements_per_second(&self) -> f64
pub async fn average_elements_per_second(&self) -> f64
Get the average throughput over recent intervals.
Sourcepub fn interval_duration(&self) -> Duration
pub fn interval_duration(&self) -> Duration
Get the configured interval duration.
Sourcepub async fn peak_elements_per_second(&self) -> f64
pub async fn peak_elements_per_second(&self) -> f64
Get the peak throughput.
Auto Trait Implementations§
impl Freeze for ThroughputTracker
impl !RefUnwindSafe for ThroughputTracker
impl Send for ThroughputTracker
impl Sync for ThroughputTracker
impl Unpin for ThroughputTracker
impl UnsafeUnpin for ThroughputTracker
impl !UnwindSafe for ThroughputTracker
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