load-test
A CLI tool to load test your APIs
Installation
Install @appyhigh/load-test in a project
$ npm install @appyhigh/load-test
Or install it globally
Windows
# npm install -g @appyhigh/load-test
Linux/ MacOS
$ sudo npm install -g @appyhigh/load-test
Config file
To run this project, you will need to create a .json
configuration file and pass it while executing as mentioned below
{
// the 'requests' key is required
"requests":[
{
"method":<GET | POST | PUT | DELETE>,
"url":<your-api-url>,
"body":{
// body to send with the request
},
"params":{
// params to send with the request
}
}
// you can batch multiple requests together by adding more objects in the "requests" array
],
// the 'options' is optional
"options":{
// All the options supported by k6.io are valid and can be added here
// Refer to their documentations here - https://k6.io/docs/using-k6/k6-options/reference
}
}
Usage
load-test -c=<path-to-config-file> -o=<output-path || 'current'> -s<optional>
Flag | Alias | Type | Required | Description |
---|---|---|---|---|
-c | --config | String | true | The path to the .json configuration file |
-o | --output | String | true | The path to save the result output file. You can set it to current to save the result in <current-dir>/load-tests
|
-s | --show-result | Boolean | false | Show the result in text editor on test completion |