This API is used to perform stress tests on other endpoints, simulating multiple requests with a configurable payload.
The API repeatedly sends requests to the provided endpoint, with the ability to:
- Set a delay between requests (
delayInSeconds) - Send a customizable request body (
body) - Specify the HTTP method (
method) - Define how many times the request should be repeated (
apiCallTimes) - Automatically increment certain fields in the request body for each call (
shouldIncrementFields) - Define which fields should be ignored during increment (
skipIncrementFields)
You can use this link to stringfy your body or params
- apiEndpoint: The URL where the requests will be sent.
- delayInSeconds: Time in seconds to wait between each request. (Optional - Default 1 second)
- body: Request body to be sent. Must be a valid JSON string. (Optional)
- method: HTTP method to be used (e.g., POST, GET).
- apiCallTimes: Number of times the request will be repeated. (Optional - Default 1)
- shouldIncrementFields: Defines whether certain fields in the body should be automatically incremented. (Optional)
- skipIncrementFields: List of fields that should not be incremented. (Optional)
POST /stress-test
{
"apiEndpoint": "http://your-api-url/your-endpoint",
"delayInSeconds": 1,
"body": "your body in JSON string format",
"params": "your params in JSON string format",
"method": "POST",
"apiCallTimes": 100,
"shouldIncrementFields": true,
"skipIncrementFields": [
"field1_to_skip_increment",
"field2_to_skip_increment",
"field3_to_skip_increment"
]
}- Clone this repository:
git clone https://github.com/cordeirogustavo/stress-test-api.git- Install dependency
npm i- Run locally
npm run dev