Official website: http://locust.io/
Github:https://github.com/locustio/locust
Brief introduction
Locust is an open source load testing tool. Use Python code to define user behavior, or to simulate millions of users.
Locust is a very simple to use, distributed, User load testing tool. Locust is primarily a load test for websites or other systems that can test how many users a system can handle concurrently.
The Locust is completely time-based, so a single machine supports thousands of concurrent users. Compared to many other event-driven applications, Locust does not use callbacks, but uses lightweight processing gevent.
Characteristics
- Write user test scenarios using pure Python code; UIs or XML is not required
- Distributed & Scalable-supports thousands of users
- Web-based UI
- Can test any system, although Locust is Web-oriented, but can also test any other system
# #安装:
pip install locustio
# #示例代码:
from locust import HttpLocust, TaskSet, taskclass WebsiteTasks(TaskSet): def on_start(self): self.client.post("/login", { "username": "test_user", "password": "" }) @task def index(self): self.client.get("/") @task def about(self): self.client.get("/about/")class WebsiteUser(HttpLocust): task_set = WebsiteTasks min_wait = 5000 max_wait = 15000
Other information
Python Module Introduction-locustio: Performance testing tools Locustio Chinese documents
Background
We have studied existing solutions that are not in line with the requirements. Like Apache JMeter and Tsung. JMeter is UI-based and easy to get started with, but the configuration of the test scenario via the UI click makes it out of programming fun. Second jmeter based on threading, it is almost impossible to simulate thousands of users. Tsung is based on Erlang, which can simulate thousands of users and is easy to scale, but it is an XML-based DSL that describes the scenario as weak and requires a lot of data processing to know the test results.
In any case, we try to solve these problems through Locust, hoping that none of the above problems will be a locust pain point.
Maybe you'll say we're trying to scratch the itch. I hope other people like us think it's a meaningful thing.
Author
- Jonatan Heyman (@Jonatanheyman on Twitter)
- Carl bystr?m (@cgbystrom on Twitter)
- Joakim Hamrén (@Jahaaja on Twitter)
- Hugo Heyman (@Hugoheyman on Twitter)
Python-based performance load test Locust-1 introduction