This project integrates Locust 🐍 for load testing, InfluxDB 📊 for metric collection, and Grafana 📈 for real-time visualization. The goal is to simulate high-traffic scenarios, monitor system performance, and analyze results efficiently. The entire environment is orchestrated with Docker Compose for easy deployment and execution.
📂 load-testing-locust/
│── 📂 app/ # Source code of the application under test
│── 📂 config/ # Configuration files for Docker, InfluxDB, Locust, and Grafana
│── 📂 docs/ # Documentation and reports
│── 📂 observability/ # Metrics and tracing configuration
│── 📂 scripts/ # Automation and execution scripts
│── 📂 tests/ # Load testing scripts with Locust
│── 📂 Makefile # Automation commands
│── docker-compose.yml # Service orchestration with Docker
│── README.md # Main documentation
│── setup.sh # Installation script
Ensure you have the following installed before running the project:
- 🐳 Docker and Docker Compose
- 🐍 Python 3.x (for manual testing if needed)
- 💪 Make (for automation)
1️⃣ Clone the repository:
git clone https://github.com/omaciasd/load-testing-locust.git
cd load-testing-locust2️⃣ Copy the environment variables template:
cp config/.env.example config/.envThen edit config/.env to customize settings.
3️⃣ Build and start the services:
make upThe Makefile provides simple commands for managing the environment:
-
Rebuild services:
make rebuild
-
View logs:
make logs
-
Run tests:
make test
Open your browser and go to: 👉 http://localhost:8089 Here, you can define the number of users and the ramp-up rate to start the test.
Access Grafana at: 👉 http://localhost:3000
A preconfigured dashboard for Locust metrics is available. Navigate to Dashboards → Load Testing Overview to analyze key metrics such as:
- Requests per second (RPS)
- Response times
- Error rates
- Active users
To check if Locust is sending data to InfluxDB, run:
docker exec -it influxdb influx query --org my-org 'from(bucket:"locust_metrics") |> range(start: -5m)'You should see response times and HTTP status codes.
To stop services:
make downTo remove all stored volumes and data:
make cleanThis project is licensed under the MIT License.
- Fork the repository
- Create a new branch (
git checkout -b feature-new) - Commit your changes (
git commit -m 'Add new feature') - Push to the branch (
git push origin feature-new) - Open a Pull Request
Pull requests are welcome! Feel free to fork this repo and submit improvements. 🚀
🔥 Happy Testing! 🏆