# Locust
[![PyPI](https://img.shields.io/pypi/v/locust.svg)](https://pypi.org/project/locust/)
[![PyPI](https://img.shields.io/pypi/pyversions/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 to 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, between
class 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.
<img src="docs/images/total_requests_per_second.png" alt="Locust UI charts" width="200"/> <img src="docs/images/webui-running-statistics.png" alt="Locust UI stats" width="200"/> <img src="docs/images/locust_workers.png" alt="Locust UI workers" width="200"/> <img src="docs/images/webui-splash-screenshot.png" alt="Locust UI start test" width="200"/>
#### 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)
* ...
## Links
* Documentation: [docs.locust.io](https://docs.locust.io)
* Support/Questions: [StackOverflow](https://stackoverflow.com/questions/tagged/locust)
* Chat/discussion: [Slack](https://locustio.slack.com) [(signup)](https://communityinviter.com/apps/locustio/locust)
## Authors
* Maintainer: [Lars Holmberg](https://github.com/cyberw)
* Modern 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).
没有合适的资源?快使用搜索试试~ 我知道了~
Locust负载测试工具 v2.24.1.zip
共339个文件
py:106个
tsx:69个
ts:42个
需积分: 0 0 下载量 144 浏览量
2024-05-10
14:41:44
上传
评论
收藏 2.05MB ZIP 举报
温馨提示
软件测试
资源推荐
资源详情
资源评论
收起资源包目录
Locust负载测试工具 v2.24.1.zip (339个子文件)
supervisord.conf 2KB
.coveragerc 300B
application.css 9KB
tables.css 1KB
custom-stats-table.css 761B
theme-overrides.css 268B
Dockerfile 970B
.dockerignore 203B
.eslintrc 1KB
.git-blame-ignore-revs 599B
.gitattributes 470B
.gitignore 398B
.gitignore 36B
index.html 21KB
report.html 10KB
extend.html 2KB
stats_data.html 1KB
dev.html 1KB
index.html 901B
index.html 873B
report.html 513B
report.html 513B
auth.html 501B
auth.html 473B
favicon.ico 8KB
favicon.ico 8KB
favicon.ico 8KB
MANIFEST.in 149B
tox.ini 1KB
index-fd3e763b.js 1.57MB
echarts.common.min.js 606KB
jquery-1.11.3.min.js 94KB
locust.js 10KB
chart.js 5KB
jquery.jqote2.min.js 3KB
jquery.tools.min.js 3KB
extend.js 2KB
tasks.js 1KB
vintage.js 1KB
package.json 2KB
settings.json 1KB
tsconfig.json 675B
launch.json 652B
package.json 536B
launch_locust.json 512B
extensions.json 102B
LICENSE 1KB
yarn.lock 220KB
Makefile 473B
application.css.map 2KB
tables.css.map 411B
CHANGELOG.md 108KB
README.md 5KB
README.md 2KB
SECURITY.md 727B
CONTRIBUTING.md 475B
README.md 0B
ui-screenshot-workers.png 148KB
webui-splash-screenshot.png 137KB
locust_workers.png 107KB
ui-screenshot-stats.png 94KB
ui-screenshot-charts.png 78KB
ui-screenshot-start-test.png 63KB
webui-running-statistics.png 51KB
response_times.png 42KB
total_requests_per_second.png 41KB
number_of_users.png 33KB
userclass_picker_example.png 28KB
logo.png 24KB
logo.png 19KB
logo.png 19KB
.prettierrc 167B
hello.proto 219B
test_dispatch.py 162KB
test_runners.py 155KB
test_main.py 82KB
runners.py 66KB
test_web.py 51KB
stats.py 45KB
test_stats.py 33KB
argument_parser.py 31KB
test_fasthttp.py 30KB
main.py 28KB
web.py 28KB
fasthttp.py 26KB
test_locust_class.py 25KB
dispatch.py 18KB
test_parser.py 18KB
task.py 16KB
clients.py 14KB
test_tags.py 13KB
test_http.py 12KB
env.py 12KB
dispatch.py 10KB
users.py 10KB
test_load_locustfile.py 8KB
event.py 8KB
test_log.py 7KB
test_env.py 7KB
testcases.py 7KB
共 339 条
- 1
- 2
- 3
- 4
资源评论
稀稀落落987
- 粉丝: 1255
- 资源: 437
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- AutoHotKey 2.0中文帮助文件
- 基于Docker-compose的Elasticsearch集群每个节点均是独立docker-compose配置而成源码.zip
- 目标检测-零售食品LOGO检测数据集-40000张图-+对应VOC-COCO-YOLO三种格式标签+数据集划分脚本
- 目标检测-零售食品LOGO检测数据集-30000张图-+对应VOC-COCO-YOLO三种格式标签+数据集划分脚本
- 目标检测-零售食品LOGO检测数据集-20000张图-+对应VOC-COCO-YOLO三种格式标签+数据集划分脚本
- 目标检测-零售食品LOGO检测数据集-10000张图-+对应VOC-COCO-YOLO三种格式标签+数据集划分脚本
- 基于GUI+MYSQL+JAVA图书管理系统文档说明+源码(高分大作业项目).zip
- 基于Qt使用C++实现图书管理系统源码+数据库(95分以上).zip
- 基于GUI+MYSQL+JAVA票务管理系统文档介绍+源码+数据库(高分大作业).zip
- Java项目-购物网站系统(java+Servlet+JSP+Mysql)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功