A small HTTP load testing CLI built in Rust using tokio,
reqwest, clap, and indicatif.
- Rust and Cargo installed
- Internet access or a local HTTP server to test against
The tool accepts the following arguments:
--url <URL>(required)--method <METHOD>(GET, POST, PUT, PATCH, DELETE; default: GET)--concurrency <N>(number of workers; default: 10)--duration <DURATION>(e.g.10s,1m)--data <BODY>(optional; mainly for POST/PUT)--header <KEY: VALUE>(can be repeated)--timeout <DURATION>(per-request timeout; default: 5s)
Example: simple GET test against httpbin for 10 seconds with 5 workers:
cargo run -- \
--url https://httpbin.org/get \
--method GET \
--concurrency 5 \
--duration 10s./target/release/http_load_tester \
--url https://httpbin.org/get \
--method GET \
--concurrency 5 \
--duration 5s \
--header "User-Agent: RustLoadTester" \
--header "X-Test: Example"At the end of a run, the tool prints aggregate metrics similar to:
Metrics {
total_requests: <u64>,
total_errors: <u64>,
RPS: <f64>,
error_rate: <f64>,
min_latency: <Duration>,
max_latency: <Duration>,
p95_latency: <Duration>
}