stresster is a command line utility to stress test REST API endpoints. It is developed using a Rust programming language and uses tokio async runtime to concurrently send requests. This makes it fast.
- Control number of requests sent
- Send HTTP Headers
- SSPL/TLS Certificate
- All the major HTTP methods (GET, POST, PUT, PATCH, DELETE) are supported
- Send JSON payload
It is being developed as a hobby project to learn Rust so use it at your own risk.
$ git clone https://github.com/vbmade2000/stresster.git
$ cd stresster
$ cargo build --release
$ cargo run
You should see help text on screen.
error: The following required arguments were not provided:
--config <config>
USAGE:
stresster --config <config> --format <format> --requests <total_requests>
For more information try --help
Specify required parameters related to HTTP requests (headers, payload etc) in a file in a JSON format.
- url: A REST API URL to test (mandatory)
- ssl_cert: SSL/TLS certificate (.cert file) to connect to secure URL (optional)
- method: HTTP Method to be used for request
- payload: A JSON object containing a payload to be sent with request (optional)
- headers: A JSON object containing HTTP headers in the form of key: value pairs. Case doesn't matter here. (optional)
- --config: A file containing a requested related data in JSON format. (mandatory)
- --format: AN output format. Default is table but you can see output in json format too. (optional).
- --requests: Total number of requests to send. (mandatory)
cargo run -- --requests 5 -c payload.json
Here target server is not up so status code is 0.
+-------------+-------+
| Status Code | Count |
+-------------+-------+
| 0 | 5 |
+-------------+-------+
{
"url": "http://localhost:15000/gettest",
"ssl_cert": "./test_server/cert.pem",
"method": "get",
"payload": {
"name": "Malhar Vora"
},
"headers": {
"User-Agent": "stresster",
"Content-Type": "application/json"
}
}
If values for following variables are different from shown below then set new values in run_tests script in current directory.
STRESSTER_PATH=./target/debug/stresster
DATA_FILE_PATH=./sample_payload.json
LOG_FILE_PATH=./stresster.log
Run tests using by executing following script.
./run_tests