Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

http-test

Another HTTP stress test tool — simple, concurrent load testing via curl and tokio.

Important

Learning project — not for real benchmarking. This exists to learn Rust, tokio, and libcurl. It fires concurrent GETs and prints GOT = ..., with no timing, histograms, or proper error handling (unwrap() on failure). For real usage, use a mature tool instead:

Features

  • Fire N concurrent GET requests against a single URL
  • Async concurrency with tokio multi-thread runtime + libcurl
  • Channel-based result collection (tokio::sync::mpsc)

Prerequisites

  • Rust 1.70+ (rustup recommended)
  • libcurl development headers (usually pre-installed on macOS/Linux)

Install

# From source
git clone https://github.com/StanleyWorks/http-stress
cd http-test
cargo build --release
# Binary at ./target/release/http-test

Or run without installing:

cargo run -- <url> --requests 100

Usage

Usage: http-test [OPTIONS] <url>

Arguments:
  <url>  The URL to benchmark

Options:
  -r, --requests <number>  Number of concurrent requests [default: 1]
  -h, --help               Print help
  -V, --version            Print version

Examples

# Single request
http-test https://example.com

# 50 concurrent requests
http-test https://example.com --requests 50
http-test https://example.com -r 50

# Local service
http-test http://localhost:3000 -r 100

Output (one line per completed request, order is non-deterministic):

GOT = Request sent.
GOT = Request sent.
...

Exit code is 0 on completion. Failed curl operations currently panic (unwrap) — this will become proper error reporting.

Note

If you need latency percentiles, throughput, or pass/fail criteria, reach for oha (oha -n 1000 -c 50 https://example.com) or similar — this tool intentionally does not provide them.

How it works

  1. Parses <url> and --requests with clap.
  2. Builds a tokio multi-thread runtime.
  3. Spawns a printer task that drains an mpsc channel and prints GOT = ....
  4. Spawns N tasks, each performing a blocking curl GET via Easy2 + custom Collector handler.
  5. Drops the original sender so the channel closes once all request tasks finish, then awaits everything.

See src/main.rs.

Roadmap

  • Timing / latency histograms and summary stats
  • Configurable HTTP method, headers, and body
  • Proper error handling instead of unwrap()
  • Keep-alive / connection reuse options
  • Rate limiting and duration-based runs

Roadmap is aspirational for learning — if you need these today, use oha or k6.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages