#[non_exhaustive]pub enum MetricsMode {
Disabled,
Interval,
Window(Duration),
}Expand description
Controls whether a run emits live metrics and how interval samples are shaped.
Library metrics modes are every-sample contracts. Interval forwards each
libiperf interval sample, and Window forwards each completed aggregation
window. Internally those streams use unbounded queues so the libiperf
reporting callback is not blocked by application code. Keep the returned
MetricsStream drained for long-running runs, or leave metrics disabled.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Disabled
Do not register the libiperf interval callback.
Interval
Emit one event for every libiperf interval sample.
This mode preserves every sample. It is appropriate for short runs or consumers that continuously drain the stream.
Window(Duration)
Aggregate interval samples into fixed-duration summary windows.
This mode still consumes every libiperf interval sample internally. It
emits fewer public events than Interval, but the stream should still be
drained for long-running runs so completed windows do not accumulate.
Implementations§
Source§impl MetricsMode
impl MetricsMode
Sourcepub const fn is_enabled(self) -> bool
pub const fn is_enabled(self) -> bool
Return true when this mode installs the libiperf metrics callback.
Trait Implementations§
Source§impl Clone for MetricsMode
impl Clone for MetricsMode
Source§fn clone(&self) -> MetricsMode
fn clone(&self) -> MetricsMode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more