A comprehensive performance testing framework using Locust for API load testing. This project provides a structured approach to performance testing with real-time monitoring and detailed reporting capabilities.
- Real-time metrics monitoring
- Configurable test scenarios
- Detailed reporting capabilities
- Custom error handling
- Multiple endpoint testing
- Easy-to-use web interface
locust-project/
├── config/
│ └── config.yaml # Configuration settings
├── locustfiles/
│ ├── __init__.py
│ └── user_behavior.py # Test scenarios
├── reports/
│ └── .gitkeep # Directory for test reports
├── utils/
│ ├── __init__.py
│ └── helpers.py # Utility functions
├── requirements.txt # Project dependencies
└── run.py # Main execution script
- Python 3.x
- pip3 (Python package manager)
- Clone the repository:
git clone https://github.com/poojamehta01/locust-performance-framework.git
cd locust-performance-framework
- Install dependencies:
pip3 install -r requirements.txt
locust -f locustfiles/user_behavior.py --web-port=8090 --host=https://jsonplaceholder.typicode.com
- Open your browser
- Navigate to:
http://localhost:8090
- Configure test parameters:
- Number of users
- Spawn rate
- Start the test
Current implementation includes:
- GET
/posts
- Fetch all posts - POST
/posts
- Create new post - GET
/users/{id}
- Fetch user details - GET
/comments?postId={id}
- Fetch post comments
Test reports are automatically generated in the reports/
directory:
- CSV reports for requests
- CSV reports for failures
- CSV reports for exceptions
- HTML reports for overall test results
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Pooja Mehta
- Medium: @poojamehta1197
- GitHub: @poojamehta01
Made with ❤️ for testers and developers