Expand description
Shared bandwidth measurement loop for download/upload tests.
Eliminates duplication between download.rs and upload.rs by providing:
LoopState— unified state for throttled speed sampling, peak tracking, progress bar updates, and atomic byte countingrun_concurrent_streams— shared spawn/collect/report pattern that both download and upload tests delegate to
Each I/O operation (download chunk, upload round) calls record_bytes()
to update shared state. Call finish() at the end to compute final results.
Structs§
- Bandwidth
Result - Final result from a bandwidth test.
- Loop
State - Shared state for a bandwidth test (download or upload).
Constants§
- SAMPLE_
INTERVAL_ MS - Throttle interval for speed sampling (20 Hz max).
Functions§
- run_
concurrent_ streams - Run a bandwidth test using multiple concurrent streams.