| Crates.io | cargo-kt |
| lib.rs | cargo-kt |
| version | 0.0.12 |
| created_at | 2026-01-06 01:33:32.326337+00 |
| updated_at | 2026-01-06 01:33:32.326337+00 |
| description | A simple yet powerful command-line HTTP stress testing tool written in Rust |
| homepage | |
| repository | |
| max_upload_size | |
| id | 2024911 |
| size | 109,439 |
A simple yet powerful command-line HTTP stress testing tool written in Rust. It leverages tokio, hyper, and rustls to provide high-concurrency, asynchronous performance for load testing your web endpoints.
For Linux users, the quickest way to get started is by downloading the pre-compiled binary directly from GitHub Releases. This method does not require you to have the Rust toolchain installed.
curl -L -o kt https://github.com/lsk569937453/loadTesting/releases/download/0.0.11/kt-x86_64-unknown-linux-gnu
chmod +x ./kt
To build and run this tool, you need the Rust toolchain (including cargo) installed on your system.
git clone git@github.com:lsk569937453/loadTesting.git
cd loadTesting
cargo build --release
The compiled binary will be located at target/release/kt.
The tool is configured entirely through command-line arguments.
kt [OPTIONS] <URL>
| Option | Alias | Description | Default Value |
|---|---|---|---|
--concurrency <NUM> |
-c |
The number of concurrent workers (threads) to run. | 50 |
--duration <DURATION> |
-d |
The duration of the test. Valid units: s (seconds), ms (milliseconds), m (minutes), d (days). Mutually exclusive with --requests. |
None |
--requests <REQUESTS> |
-r |
The total number of requests to send. Mutually exclusive with --duration. |
500000 |
--header <KEY:VALUE> |
-H |
Adds a custom HTTP header to the request. This option can be used multiple times. Format: "Key:Value". |
None |
--body <DATA> |
-b |
The HTTP request body data. If the value starts with @, the rest is treated as a file path to read from. |
None |
--help |
-h |
Print help information. | |
--version |
-V |
Print version information. |
Run a test with default settings (50 concurrent workers for 10 seconds).
kt http://localhost:8080/
Run a test with 200 concurrent workers for 1 minute against a secure endpoint.
kt -c 200 -d 1m https://api.example.com/health
Simulate a request with a specific User-Agent and an Authorization token.
kt \
-H "User-Agent: MyTestClient/1.0" \
-H "Authorization: Bearer my-secret-token" \
https://api.example.com/data
Providing a body with --body or -b will automatically change the HTTP method to POST.
kt \
-b '{"name":"test","value":"123"}' \
-H "Content-Type: application/json" \
https://api.example.com/items
If the value for the --body argument starts with @, the rest of the string is interpreted as a file path. The tool will read the file's content and use it as the request body. Assuming you have a file named data.json:
{
"user_id": 12345,
"payload": {
"action": "create",
"details": "..."
}
}
You can send its content like this:
kt \
-b @data.json \
-H "Content-Type: application/json" \
https://api.example.com/v2/events
After the specified duration, the application will stop sending new requests, wait for all pending requests to complete, and then print a detailed summary report to the console. This report provides a comprehensive overview of the performance of the target server under load.
Http Stress Test Summary
====================================
[Session]
URL: http://127.0.0.1:8090/
Concurrency: 50 threads
Test Duration: 10.00 s
[Throughput]
Requests/sec: 98945.92
Transfer Rate: 5.85 MB/s
[Latency]
Average: 504 µs
StdDev: 217 µs
Slowest: 108 ms
Fastest: 58 µs
[Latency Percentiles]
P50 (Median): 483 µs
P90: 698 µs
P95: 778 µs
P99: 968 µs
P99.9: 1 ms
[Data Transfer]
Total Data: 58.51 MiB
Size/request: 62.00 bytes
[Status Code Distribution]
[200] 989633 responses (100.00%)
[Error Distribution]
(No errors)