Skip to main content

run_bandwidth_test

Function run_bandwidth_test 

Source
pub async fn run_bandwidth_test<F, Fut>(
    client: Client,
    server: &Server,
    test_label: &str,
    is_verbose: bool,
    test_fn: F,
) -> Result<TestRunResult, Error>
where F: FnOnce(Arc<Tracker>) -> Fut, Fut: Future<Output = Result<(f64, f64, u64, Vec<f64>), Error>>,
Expand description

Run a bandwidth test with latency-under-load monitoring.

This is a template method that handles:

  • Progress bar setup
  • Background latency monitoring
  • Test execution via the provided closure
  • Result aggregation

§Arguments

  • client - HTTP client to reuse
  • server - Server to test against
  • test_label - Label for progress display
  • is_verbose - Whether to show visible progress
  • test_fn - Async closure that runs the actual bandwidth test

§Errors

Returns Error if the test fails.