如何在没有UI的情况下生成locust html文件?

how to generate locust html file without UI?

如何在没有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

同上错误。

config 文件应遵循所有 document examples, key=value:

# 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

此外,还有机会生成 html 文件添加到 cli:

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