- 🚀 Send concurrent HTTP requests to a specified URL
- ⚙️ Customize the number of requests, concurrency level, and timeout duration
- 📊 Measure response times and calculate average, minimum, and maximum values
- 📈 Calculate throughput (requests per second)
- 🌈 Display progress bar to track benchmarking progress
- 💅 Generate colorful and formatted output for easy readability
To install httpbench
, make sure you have Go installed on your system. Then, run the following command:
go get github.com/simonlariz/httpbench
Or you can clone the repository and build the binary manually:
git clone https://github.com/SimonLariz/httpbench.git
cd httpbench
go build -o ./bin/httpbench cmd/httpbench/main.go
Then you can run the binary:
./bin/httpbench
To start benchmarking an HTTP endpoint, run the following command:
httpbench -url "http://example.com/api" -n 1000 -c 10 -timeout 5s
This command sends 1000 requests to http://example.com/api
with a concurrency level of 10 and a timeout of 5 seconds. You can customize these values based on your requirements.
-url
: The URL of the HTTP endpoint to benchmark-n
: The total number of requests to send-c
: The concurrency level (number of requests to send concurrently)-timeout
: The duration to wait for a response from the server
For more information about the available options, run httpbench -h
.
httpbench
provides various customization options for the progress bar and output formatting. You can modify the following properties:
- Progress bar width
- Progress bar template string
- Progress bar fill character
- Progress bar empty character
- Current and total count format
- Progress bar color
- Progress bar refresh rate
Refer to the source code and the github.com/cheggaaa/pb
package documentation for more details on customization options.
Please refrain from benchmarking, load testing, or performing any unauthorized tests on websites or applications without explicit permission from the site maintainers. Unauthorized testing can put unnecessary strain on the servers and may be considered a form of attack.
- Support for POST request with request bodies
- Integration with popular monitoring tools (e.g., Prometheus, Grafana)
- Web-based dashboard for monitoring and analyzing benchmark results
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on the GitHub repository.
This project is licensed under the MIT License.