pub struct ThroughputMonitoring { /* private fields */ }Expand description
Helper to monitor throughput over fixed windows.
Implementations§
Source§impl ThroughputMonitoring
impl ThroughputMonitoring
Sourcepub fn new(throughput_duration: Duration) -> ThroughputMonitoring
pub fn new(throughput_duration: Duration) -> ThroughputMonitoring
Creates a new throughput monitor with the specified window duration.
Sourcepub fn tick(&mut self) -> bool
pub fn tick(&mut self) -> bool
Records a tick and returns true if a measurement window completed.
Sourcepub fn last_throughput(&self) -> u32
pub fn last_throughput(&self) -> u32
Returns the throughput from the most recent completed window.
Sourcepub fn total_measured_ticks(&self) -> u32
pub fn total_measured_ticks(&self) -> u32
Returns the total number of ticks measured across all windows.
Trait Implementations§
Source§impl Debug for ThroughputMonitoring
impl Debug for ThroughputMonitoring
Auto Trait Implementations§
impl Freeze for ThroughputMonitoring
impl RefUnwindSafe for ThroughputMonitoring
impl Send for ThroughputMonitoring
impl Sync for ThroughputMonitoring
impl Unpin for ThroughputMonitoring
impl UnwindSafe for ThroughputMonitoring
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