locust官方文档
https://docs.locust.io/en/stable/what-is-locust.html
locust初探
介绍
1、Locust是一个分布式性能测试的开源工具
2、一台机器支持数千用户进行压测
3、过程可以通过web UI实时监控
4、主要面向web,但不限于web
5、locust的http连接在不同系统有不同限制(本身不限制)
安装
python版本要求,3.6及以上
pip install locust
locust --help
locust初探
使用
先按照官方示例代码进行
`
from locust import HttpUser, task

class HelloWorldUser(HttpUser):
@task
def hello_world(self):
self.client.get("/hello")
self.client.get("/world")
`
该用户将向 发出 HTTP 请求/hello,然后/world一次又一次地向 发出请求。

将代码放在当前目录中名为locustfile.pylocust的文件中并运行:
locust初探
Locust 的网页界面
启动 Locust 后,打开浏览器并将其指向http://localhost:8089。
locust初探

相关文章:

  • 2021-07-09
  • 2021-12-02
  • 2021-11-30
  • 2022-01-07
  • 2021-08-31
  • 2021-04-04
  • 2021-11-04
  • 2022-01-22
猜你喜欢
  • 2021-07-07
  • 2022-01-11
  • 2021-09-29
  • 2022-12-23
  • 2021-05-19
  • 2022-12-23
  • 2021-07-20
相关资源
相似解决方案