Slapper is a simple load testing tool written in Go, which can send HTTP requests to your server and display the results in a histogram. It provides basic performance metrics, such as request rate, response times, and error rates.
- Basic performance metrics
- Histogram visualization of response time distribution
- Adjustable request rate, timeout, and worker count
- Supports multiple request targets
- Configurable ramp-up time for gradually increasing request rate
Just download a release or install SlapperX via
go install github.com/s-macke/slapperx@latest
To use Slapper, you need to have Go installed on your machine. You can download Go from the official website.
After installing Go, clone this repository and build the binary:
git clone https://github.com/s-macke/SlapperX.git
cd SlapperX
go build
Here is an example of how to use Slapper:
./slapper -targets targets.http -workers 8 -timeout 30s -rate 50 -minY 0ms -maxY 100ms -rampup 10s
-targets
: Targets file containing the REST request data to be tested in the .http format..-workers
: Number of workers sending requests concurrently (default 50).-timeout
: Request timeout duration (default 30 seconds).-rate
: Desired request rate per second (default 50).-minY
: Minimum Y-axis value for the histogram (default 0 milliseconds).-maxY
: Maximum Y-axis value for the histogram (default 100 milliseconds).-rampup
: Duration to ramp up to the desired request rate (default 0 seconds).
q
: Quit the program.r
: Reset the statistics.k
: Increase request rate by 10j
: Decrease request rate by 10Ctrl+C
: Quit the program.
The targets file follows the same format as the Jetbrains .http
files.
You can find the full specification in the
JetBrains documentation.
Here is an example:
GET https://api.example.com/users
Authorization: Bearer your_token_here
Content-Type: application/json
###
POST https://api.example.com/users
Authorization: Bearer your_token_here
Content-Type: application/json
{
"name": "John Doe",
"email": "john.doe@example.com"
}
###
PUT https://api.example.com/users/123
Authorization: Bearer your_token_here
Content-Type: application/json
{
"email": "updated.email@example.com"
}
In this example, we have three HTTP requests:
- A
GET
request to retrieve a list of users. - A
POST
request to create a new user. - A
PUT
request to update an existing user's email.
Each request includes headers, such as Authorization
and Content-Type
, and uses the ###
separator to distinguish between requests.
Contributions are welcome! If you have found a bug or have a feature request, please create an issue or submit a pull request.
This project is released under the MIT License.