如何在没有UI的情况下生成locust html文件?
locustfile = /mnt/locust/locustfile.py
headless = true
host = https://uat.xxx.biz
users = 1000
spawn-rate = 1
run-time = 25m
expect-workers=4
master
html=basic.html
我遇到了错误
master_1 | locust: error: unrecognized arguments: --html=basic.html
编辑
蝗虫 1.4.1
docker run -p 127.0.0.1:8089:8089 -v $PWD:/mnt/locust tnt_locust:1.0.0 -f /mnt/locust/locustfile.py --headless -u 10 -r 10 --run-time 15s --html=basicNew.html
同样的错误。
最佳答案
配置文件应遵循所有document examples , 键=值:
# master.conf in current directory
locustfile = locust_files/my_locust_file.py
headless = true
master = true
expect-workers = 5
host = ''
users = 100
spawn-rate = 10
run-time = 10s
html=base.html
根据你的例子,主值已经被跳过
并通过命令运行它:
locust --config=master.conf
顺便说一下,试过没有 master 和 workers 参数吗?比如:
# master.conf in current directory
locustfile = locust_files/my_locust_file.py
headless = true
host = ''
users = 10
spawn-rate = 10
run-time = 10s
html=base.html
此外,还有机会生成添加到 cli 的 html 文件:
locust -f locustfile.py --headless -u 10 -r 10 --run-time 15s --html=basicNew.html
顺便说一下,由于1.4.1版本的locust,它还没有HTML报告。仅从 1.4.2 开始添加:
1.4.2 Multiple improvements for charting including tooltips etc Added –html option to save HTML report docs.locust.io/en/stable/changelog.html#id3 Lots of other small fixes.
尝试将版本更新到 1.4.2 或最新的 1.4.3
关于python - 如何生成没有UI的locust html文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66578812/