{"id":24013229,"url":"https://github.com/cihat-kose/locust-petstore-performance-testing","last_synced_at":"2026-06-07T21:31:46.266Z","repository":{"id":265559752,"uuid":"896256650","full_name":"cihat-kose/locust-petstore-performance-testing","owner":"cihat-kose","description":"A Locust project for load testing the Swagger Petstore API, simulating concurrent user interactions to measure system performance under heavy load.   Target API: Swagger Petstore (petstore.swagger.io)","archived":false,"fork":false,"pushed_at":"2025-07-31T18:18:37.000Z","size":283,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-30T08:47:16.026Z","etag":null,"topics":["api-testing","load-testing","locust","locust-tests","performance-testing","python","rest-api"],"latest_commit_sha":null,"homepage":"https://petstore.swagger.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cihat-kose.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-29T22:24:39.000Z","updated_at":"2025-07-31T18:18:37.000Z","dependencies_parsed_at":"2024-12-30T02:34:32.345Z","dependency_job_id":"2dc1f9a2-3dc5-40d8-9242-5a60be9c4f2d","html_url":"https://github.com/cihat-kose/locust-petstore-performance-testing","commit_stats":null,"previous_names":["chatgthb/locustperformanstest","chatgthb/locustpetstoreperformancetest","chatgthb/locust-petstore-performance-testing","cihat-kose/locust-petstore-performance-testing"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cihat-kose/locust-petstore-performance-testing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cihat-kose%2Flocust-petstore-performance-testing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cihat-kose%2Flocust-petstore-performance-testing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cihat-kose%2Flocust-petstore-performance-testing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cihat-kose%2Flocust-petstore-performance-testing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cihat-kose","download_url":"https://codeload.github.com/cihat-kose/locust-petstore-performance-testing/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cihat-kose%2Flocust-petstore-performance-testing/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285138471,"owners_count":27121052,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-18T02:00:05.759Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-testing","load-testing","locust","locust-tests","performance-testing","python","rest-api"],"created_at":"2025-01-08T06:51:44.571Z","updated_at":"2025-11-18T21:02:09.422Z","avatar_url":"https://github.com/cihat-kose.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Locust Petstore Performance Testing\n\n![Locust](https://img.shields.io/badge/Locust-Performance_Testing-2D6DB5?style=for-the-badge)\n![Python](https://img.shields.io/badge/Python-3776AB?style=for-the-badge\u0026logo=python\u0026logoColor=white)\n\nA Locust-based project designed to perform load and stress testing on the [Swagger Petstore API](https://petstore.swagger.io). This project simulates concurrent users interacting with API endpoints, measuring the system's performance and responsiveness.\n\n---\n\n## 🌐 Target API\n\n- **API Endpoint**: [Swagger Petstore](https://petstore.swagger.io)\n- **Version**: v2  \n- **Focus**: User management endpoints, including creating, updating, retrieving, and deleting users.\n\n---\n\n## 🚀 Features\n\n- Performance testing for CRUD operations on user data.\n- Simulates API requests to:\n  - **Create User** – `POST /v2/user`\n  - **Update User** – `PUT /v2/user/\u003cusername\u003e`\n  - **Get User Info** – `GET /v2/user/\u003cusername\u003e`\n  - **Delete User** – `DELETE /v2/user/\u003cusername\u003e`\n- Tracks response time, failure rates, and throughput metrics.\n\n---\n\n## 💂️ Project Structure\n\n```\nlocust-petstore-performance-testing/\n├── locustfile.py            # Locust task definitions\n├── requirements.txt         # Python dependencies\n└── README.md                # Project documentation\n\n# Generated after running tests\nreports/\n```\n\n---\n\n## 🛠️ Installation\n\n1. **Clone the Repository**  \n   ```bash\n   git clone https://github.com/cihat-kose/locust-petstore-performance-testing.git\n   cd locust-petstore-performance-testing\n   ```\n\n2. **Install Dependencies**  \n   Ensure Python 3.8+ is installed.  \n   ```bash\n   pip install -r requirements.txt\n   ```\n\n3. **Verify Locust Installation**  \n   ```bash\n   locust --version\n   ```\n\n---\n\n## ⚙️ Usage\n\n### Running the Locust Test\n\n1. **Start Locust**\n   ```bash\n   # optional: customise target host and username\n   export TARGET_HOST=https://petstore.swagger.io\n   export TEST_USER=myuser\n   locust -f locustfile.py\n   ```\n\n2. **Access Locust Web Interface**  \n   Open [http://localhost:8089](http://localhost:8089) in your browser.\n\n3. **Configure Test Parameters**  \n   - Set the number of users and spawn rate.  \n   - Click **Start Swarming** to begin the test.\n\n---\n\n## 🔍 Example API Tasks\n\n### 1. **Create User**\n\n- Endpoint: `POST /v2/user`  \n- Example Payload:  \n   ```json\n   {\n     \"id\": 249897,\n     \"username\": \"testuser\",\n     \"firstName\": \"Test\",\n     \"lastName\": \"User\",\n     \"email\": \"testuser@gmail.com\",\n     \"password\": \"12345678\",\n     \"phone\": \"1234567890\",\n     \"userStatus\": 0\n   }\n   ```\n\n---\n\n### 2. **Update User**\n\n- Endpoint: `PUT /v2/user/testuser`  \n- Example Payload:  \n   ```json\n   {\n     \"firstName\": \"Updated\",\n     \"lastName\": \"User\"\n   }\n   ```\n\n---\n\n### 3. **Retrieve User Info**\n\n- Endpoint: `GET /v2/user/testuser`\n\n---\n\n### 4. **Delete User**\n\n- Endpoint: `DELETE /v2/user/testuser`\n\n---\n\n## 📊 Results and Reports\n\nAfter executing tests, results are stored in the `reports/` directory (which is generated automatically). The Locust web interface also provides real-time metrics:\n- **Requests per second (RPS)**\n- **Response time distribution**\n- **Failures and exceptions**\n\n---\n\n## 📉 License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n---\n\n## ❓ Contact\n\nIf you encounter any issues, please open an issue in this repository.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcihat-kose%2Flocust-petstore-performance-testing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcihat-kose%2Flocust-petstore-performance-testing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcihat-kose%2Flocust-petstore-performance-testing/lists"}