一、locust是什么?
一个支持分布式架构的测试工具,能够很轻松的编写测试脚本,完成网站的并发性能测试。
官方网站(Locust - A modern load testing framework),里面有详细的使用介绍。
二、部署
(一)环境要求:Python 3.6以上,支持Win、Mac、Linux
(二)安装步骤(Win环境):
1.官网下载Pyhton的最新版本,完成安装。
2.使用 pip3 install locust 安装。如果在命令行提示无此命令,请检查Python的环境变量设置。将 Python/ 和 Python/Scripts/ 添加到 Path 变量下,或者直接到Python的Scrips/目录下开个命令行窗口运行。
C:\> pip3 install locustpip3 install locust
3.在命令行输入 locust -V检查版本,出来版本说明安装成功。
C:\>locust -V
locust 2.2.1
参数输入错误的情况下会提示找不到 locustfile ,也是已经安装好了。
C:\>locust
Could not find any locustfile! Ensure file ends in '.py' and see --help for ava