Hammer is a simple HTTP load testing tool designed to help you test the performance of your web applications. With a few configurations, you can unleash the power of goroutines and measure the response time of your server under various loads. Let's dive into how you can wield the mighty Hammer! ⚒️💻
- Target URL (-url): The URL you want to benchmark (default: http://localhost:8000) 🌐
- Total Requests (-r): Total number of requests to perform (default: 100) 📈
- Concurrency (-c): Total number of goroutines to run concurrently (default: 1) 🏃
- Timeout (-t): Request timeout in seconds (default: 20) ⏰
- Clone the Hammer repository.
- Run
go build -o ./hammer
to build the executable. - Run the executable with your desired configuration.
./hammer -url=http://your-target-url.com -r=500 -c=10 -t=30
- Command Line Flags: Accepts various configurations via command line flags.
- Goroutines: Spawns goroutines to perform concurrent requests.
- Response Time Channel: Uses a channel to collect response times from goroutines.
- Calculate Results: After all goroutines finish, it calculates and displays the results.
- Add load-testing for POST, UPDATE routes as well (Currently only supporting GET request)
This project has an MIT license, so feel free to contribute
Now you're ready to swing the Hammer and unleash the power of load testing! 💪🚀