pub struct BandwidthProfiler {
pub warmup_iterations: u32,
pub benchmark_iterations: u32,
/* private fields */
}Expand description
Accumulates bandwidth measurements and produces summary statistics.
The profiler stores individual BandwidthMeasurement records and can
compute aggregate statistics across all measurements or filtered by
transfer direction.
Fields§
§warmup_iterations: u32Number of warmup iterations (hint for benchmark drivers).
benchmark_iterations: u32Number of benchmark iterations (hint for benchmark drivers).
Implementations§
Source§impl BandwidthProfiler
impl BandwidthProfiler
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new profiler with default iteration counts (3 warmup, 10 benchmark).
Sourcepub fn with_iterations(warmup: u32, benchmark: u32) -> Self
pub fn with_iterations(warmup: u32, benchmark: u32) -> Self
Creates a new profiler with custom iteration counts.
Sourcepub fn record(&mut self, measurement: BandwidthMeasurement)
pub fn record(&mut self, measurement: BandwidthMeasurement)
Records a single bandwidth measurement.
Sourcepub fn measurement_count(&self) -> usize
pub fn measurement_count(&self) -> usize
Returns the number of recorded measurements.
Sourcepub fn measurements(&self) -> &[BandwidthMeasurement]
pub fn measurements(&self) -> &[BandwidthMeasurement]
Returns a reference to all recorded measurements.
Sourcepub fn summary(&self) -> BandwidthSummary
pub fn summary(&self) -> BandwidthSummary
Computes a summary of all recorded measurements.
If no measurements have been recorded, all summary fields will be zero
and per_direction will be empty.
Sourcepub fn summary_by_direction(
&self,
dir: TransferDirection,
) -> Option<DirectionSummary>
pub fn summary_by_direction( &self, dir: TransferDirection, ) -> Option<DirectionSummary>
Computes a summary for a single transfer direction.
Returns None if no measurements exist for the given direction.
Trait Implementations§
Source§impl Clone for BandwidthProfiler
impl Clone for BandwidthProfiler
Source§fn clone(&self) -> BandwidthProfiler
fn clone(&self) -> BandwidthProfiler
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more