Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/locustio/locust
Write scalable load tests in plain Python ππ¨
https://github.com/locustio/locust
benchmarking hacktoberfest http load-generator load-test load-testing load-tests locust performance performance-testing python
Last synced: about 14 hours ago
JSON representation
Write scalable load tests in plain Python ππ¨
- Host: GitHub
- URL: https://github.com/locustio/locust
- Owner: locustio
- License: mit
- Created: 2011-02-17T11:08:03.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2024-10-29T08:03:01.000Z (21 days ago)
- Last Synced: 2024-10-29T09:20:37.998Z (21 days ago)
- Topics: benchmarking, hacktoberfest, http, load-generator, load-test, load-testing, load-tests, locust, performance, performance-testing, python
- Language: Python
- Homepage: https://locust.cloud
- Size: 26.4 MB
- Stars: 24,904
- Watchers: 427
- Forks: 2,983
- Open Issues: 23
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
- my-awesome-starred - locust - Scalable user load testing tool written in Python (Python)
- awesomeLibrary - locust
- awesome-python-applications - Repo
- awesome-observability - Locust - Locust is an easy-to-use, distributed, user load testing tool. It is intended for load-testing web sites (or other systems) and figuring out how many concurrent users a system can handle. (4. Load Generators and Synthetic Traffic / Events & Problems)
- awesome-wp-speed-up - Locust - Scalable user load testing tool written in Python. (Load Impact Tools)
- awesome-ccamel - locustio/locust - Write scalable load tests in plain Python ππ¨ (Python)
- awesome-cloudops - Locust - raw/locustio/locust" alt="Issues"><br><img align="right" src="https://img.shields.io/github/last-commit/locustio/locust">](https://github.com/locustio/locust) | | Write scalable load tests in plain Python ππ¨ | Write scalable load tests in plain Python ππ¨ | (Tools)
- awesome-repositories - locustio/locust - Write scalable load tests in plain Python ππ¨ (Python)
- awesome-starts - locustio/locust - Scalable user load testing tool written in Python (Python)
- Fuchsia-Guide - Locust
- awesome-failure-diagnosis - Locust
- awesome-django-performance - Locust - An easy to use, scriptable and scalable performance testing tool. (Testing / Tools)
- Shopify-Guide - Locust
- awesome-locust - Source code
- CUDA-Guide - Locust
- NLP-Guide - Locust
- Bioinformatics-Guide - Locust
- Firmware-Guide - Locust
- CoreML-Guide - Locust
- Robotics-Guide - Locust
- awesome-python-testing - Locust - Scalable user load testing tool written in Python. (Load Testing)
- awesome-swedish-opensource - Locust
- Python-Guide - Locust
- awesome-python-applications - Repo
- starred-awesome - locust - Scalable user load testing tool written in Python (Python)
- awesome-hacking-lists - locustio/locust - Write scalable load tests in plain Python ππ¨ (Python)
- awesome-aiml-blog - Locust
- awesome-starts - locustio/locust - Write scalable load tests in plain Python ππ¨ (python)
- awesome-starred - locustio/locust - Write scalable load tests in plain Python ππ¨ (python)
- my-awesome - locustio/locust - generator,load-test,load-testing,load-tests,locust,performance,performance-testing,python pushed_at:2024-11 star:25.1k fork:3.0k Write scalable load tests in plain Python ππ¨ (Python)
- StarryDivineSky - locustio/locust
- best-of-web-python - GitHub - 1% open Β· β±οΈ 06.06.2024): (Web Testing)
- stars - locustio/locust - Write scalable load tests in plain Python ππ¨ (Python)
- stars - locustio/locust - Write scalable load tests in plain Python ππ¨ (Python)
README
# Locust
[![PyPI](https://img.shields.io/pypi/v/locust.svg)](https://pypi.org/project/locust/)[![Downloads](https://pepy.tech/badge/locust/week)](https://pepy.tech/project/locust)
[![Build Status](https://github.com/locustio/locust/workflows/Tests/badge.svg)](https://github.com/locustio/locust/actions?query=workflow%3ATests)
[![GitHub contributors](https://img.shields.io/github/contributors/locustio/locust.svg)](https://github.com/locustio/locust/graphs/contributors)
[![Support Ukraine Badge](https://bit.ly/support-ukraine-now)](https://github.com/support-ukraine/support-ukraine)Locust is an open source performance/load testing tool for HTTP and other protocols. Its developer-friendly approach lets you define your tests in regular Python code.
Locust tests can be run from command line or using its web-based UI. Throughput, response times and errors can be viewed in real time and/or exported for later analysis.
You can import regular Python libraries into your tests, and with Locust's pluggable architecture it is infinitely expandable. Unlike when using most other tools, your test design will never be limited by a GUI or domain-specific language.
To get started right away, head over to the [documentation](http://docs.locust.io/en/stable/installation.html).
## Features
#### Write user test scenarios in plain old Python
If you want your users to loop, perform some conditional behaviour or do some calculations, you just use the regular programming constructs provided by Python. Locust runs every user inside its own greenlet (a lightweight process/coroutine). This enables you to write your tests like normal (blocking) Python code instead of having to use callbacks or some other mechanism. Because your scenarios are βjust pythonβ you can use your regular IDE, and version control your tests as regular code (as opposed to some other tools that use XML or binary formats)
```python
from locust import HttpUser, task, betweenclass QuickstartUser(HttpUser):
wait_time = between(1, 2)def on_start(self):
self.client.post("/login", json={"username":"foo", "password":"bar"})@task
def hello_world(self):
self.client.get("/hello")
self.client.get("/world")@task(3)
def view_item(self):
for item_id in range(10):
self.client.get(f"/item?id={item_id}", name="/item")
```#### Distributed & Scalable - supports hundreds of thousands of users
Locust makes it easy to run load tests distributed over multiple machines. It is event-based (using [gevent](http://www.gevent.org/)), which makes it possible for a single process to handle many thousands concurrent users. While there may be other tools that are capable of doing more requests per second on a given hardware, the low overhead of each Locust user makes it very suitable for testing highly concurrent workloads.
#### Web-based UI
Locust has a user friendly web interface that shows the progress of your test in real-time. You can even change the load while the test is running. It can also be run without the UI, making it easy to use for CI/CD testing.
#### Can test any system
Even though Locust primarily works with web sites/services, it can be used to test almost any system or protocol. Just [write a client](https://docs.locust.io/en/latest/testing-other-systems.html#testing-other-systems) for what you want to test, or [explore some created by the community](https://github.com/SvenskaSpel/locust-plugins#users).
## Hackable
Locust's code base is intentionally kept small and doesn't solve everything out of the box. Instead, we try to make it easy to adapt to any situation you may come across, using regular Python code. There is nothing stopping you from:
* [Send real time reporting data to TimescaleDB and visualize it in Grafana](https://github.com/SvenskaSpel/locust-plugins/blob/master/locust_plugins/dashboards/README.md)
* [Wrap calls to handle the peculiarities of your REST API](https://github.com/SvenskaSpel/locust-plugins/blob/8af21862d8129a5c3b17559677fe92192e312d8f/examples/rest_ex.py#L87)
* [Use a totally custom load shape/profile](https://docs.locust.io/en/latest/custom-load-shape.html#custom-load-shape)
* [...](https://github.com/locustio/locust/wiki/Extensions)## Links
* Documentation: [docs.locust.io](https://docs.locust.io)
* Support/Questions: [StackOverflow](https://stackoverflow.com/questions/tagged/locust)
* Github Discussions: [Github Discussions](https://github.com/orgs/locustio/discussions)
* Chat/discussion: [Slack](https://locustio.slack.com) [(signup)](https://communityinviter.com/apps/locustio/locust)## Authors
* Maintainer: [Lars Holmberg](https://github.com/cyberw)
* UI: [Andrew Baldwin](https://github.com/andrewbaldwin44)
* Original creator: [Jonatan Heyman](https://github.com/heyman)
* Massive thanks to [all of our contributors](https://github.com/locustio/locust/graphs/contributors)## License
Open source licensed under the MIT license (see _LICENSE_ file for details).