torks-0.9.5 is not a library.
Torks is a lightweight, high-performance HTTP load testing tool with a real-time TUI dashboard, interactive mode, and CI-friendly output. Built with Rust and Tokio for maximum throughput.
Features
- Real-time TUI dashboard with RPS & latency charts
- Interactive quick mode — just run
torks quickand follow the prompts - Dual HTTP engine:
reqwest(full-featured) orhyper(raw speed) - Configurable worker threads via
--threads - TOML-based scenario files with multi-step flows
- HDR Histogram for accurate percentile tracking
- Variable extraction from JSON responses
- Weighted scenario selection
- Ramp-up scheduling
- JSON & CSV report export
- CI/CD threshold checks (p99, error rate, min RPS)
- Quiet mode for headless environments
Installation
Quick Start
Interactive Mode
Run torks quick with no arguments to launch the interactive wizard:
You'll be guided through:
- HTTP engine selection (reqwest or hyper)
- Worker threads (auto or custom count)
- Target URL & path
- HTTP method (arrow-key selection)
- Headers (add as many as needed)
- Request body (for POST/PUT/PATCH)
- Concurrent users, ramp-up, duration, timeout
- Summary & confirmation before launch
One-liner Mode
# GET request with 50 users for 30 seconds
# POST with 100 users, 5s ramp-up
# Quiet mode (no TUI, for CI)
# Use hyper engine for raw speed
# Control worker threads (default: CPU core count)
Scenario File
# Run a scenario file
# With JSON and CSV reports
# Quiet mode
Validate Config
Commands
| Command | Description |
|---|---|
torks |
Show banner with usage info |
torks quick |
Interactive load test wizard |
torks quick <URL> |
Quick load test with flags |
torks run <FILE> |
Run a TOML scenario file |
torks validate <FILE> |
Validate a scenario file without running |
torks --help |
Show all options |
Global Flags
| Flag | Default | Description |
|---|---|---|
--threads |
CPU core count | Number of tokio worker threads |
torks quick Flags
| Flag | Short | Default | Description |
|---|---|---|---|
--users |
-u |
10 |
Number of concurrent users |
--duration |
-d |
10s |
Test duration (30s, 5m, 1h) |
--method |
-m |
GET |
HTTP method |
--ramp-up |
-r |
0s |
Ramp-up time |
--engine |
reqwest |
HTTP engine: reqwest (full-featured) or hyper (raw speed) |
|
--quiet |
-q |
false |
Disable TUI dashboard |
torks run Flags
| Flag | Short | Default | Description |
|---|---|---|---|
--json |
Output JSON report to file | ||
--csv |
Output CSV report to file | ||
--quiet |
-q |
false |
Disable TUI dashboard |
Scenario File Format
Scenario files use TOML format:
[]
= "https://api.example.com"
= 30000
[]
= "Bearer your-token"
= "application/json"
[[]]
= "browse-api"
= 70
[[]]
= "GET"
= "/users"
[[]]
= "GET"
= "/users/{{user_id}}/posts"
[[]]
= "create-post"
= 30
[[]]
= "GET"
= "/users"
= 200
[]
= "$.data[0].id"
[[]]
= "POST"
= "/users/{{user_id}}/posts"
= '{"title": "Load Test", "content": "Hello"}'
[]
= "application/json"
[]
= 100
= "10s"
= "2m"
[]
= 500
= 5.0
= 100.0
Config Reference
[target]
| Field | Required | Default | Description |
|---|---|---|---|
base_url |
Yes | Base URL for all requests | |
timeout_ms |
No | 30000 |
Request timeout in milliseconds |
headers |
No | {} |
Default headers for all requests |
[[scenarios]]
| Field | Required | Default | Description |
|---|---|---|---|
name |
Yes | Scenario name | |
weight |
No | 100 |
Weight for random selection |
steps |
Yes | List of HTTP steps |
[[scenarios.steps]]
| Field | Required | Default | Description |
|---|---|---|---|
method |
Yes | HTTP method (GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS) | |
path |
Yes | URL path (appended to base_url) | |
headers |
No | {} |
Step-specific headers |
body |
No | Request body | |
extract |
No | {} |
Extract variables from JSON response |
expect_status |
No | < 400 |
Expected HTTP status code |
[load]
| Field | Required | Default | Description |
|---|---|---|---|
users |
Yes | Number of concurrent virtual users | |
duration |
Yes | Test duration (30s, 5m, 1h) |
|
ramp_up |
No | 0s |
Time to ramp up to full users |
[thresholds]
| Field | Required | Description |
|---|---|---|
p99_ms |
No | Max p99 latency (ms) — exits with code 1 if exceeded |
error_rate |
No | Max error rate (%) — exits with code 1 if exceeded |
min_rps |
No | Min requests/sec — exits with code 1 if below |
Variable Extraction
Chain requests by extracting values from JSON responses:
[[]]
= "POST"
= "/auth/login"
= '{"email": "test@example.com", "password": "secret"}'
[]
= "$.data.access_token"
[[]]
= "GET"
= "/api/profile"
[]
= "Bearer {{token}}"
HTTP Engines
Torks ships with two HTTP engines:
| Engine | Flag | Best For |
|---|---|---|
| reqwest (default) | --engine reqwest |
Full-featured tests: cookies, JSON, TLS, headers, multi-step scenarios |
| hyper | --engine hyper |
Raw throughput benchmarks: minimal overhead, maximum RPS |
# Default engine (reqwest) — full feature support
# Hyper engine — raw speed, ~2x RPS
CI/CD Integration
Use --quiet mode and thresholds for CI pipelines:
# GitHub Actions example
- name: Load Test
run: |
cargo install torks
torks run load-test.toml --quiet --json results.json
Torks exits with code 1 if any threshold is exceeded, making it easy to gate deployments.
License
Apache-2.0
Author
Built by Armonika