Skip to content

mehan05/http_load_tester

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

<title>Rust HTTP Load Tester</title>

Rust HTTP Load Tester

A small HTTP load testing CLI built in Rust using tokio, reqwest, clap, and indicatif.

Requirements

  • Rust and Cargo installed
  • Internet access or a local HTTP server to test against

CLI Options

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)

Run (using cargo)

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

Examples

GET with custom headers

./target/release/http_load_tester \
  --url https://httpbin.org/get \
  --method GET \
  --concurrency 5 \
  --duration 5s \
  --header "User-Agent: RustLoadTester" \
  --header "X-Test: Example"

Output

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>
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors