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

如何在没有 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 | 蝗虫:错误:无法识别的参数:--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

和上面一样的错误。

回答

配置文件应遵循所有文档示例,键=值:

# 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.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 图表的多项改进,包括工具提示等 添加 –html 选项以保存 HTML 报告
docs.locust.io/en/stable/changelog.html#id3 许多其他小修复。

尝试将版本更新到 1.4.2 或最新的 1.4.3


以上是如何在没有UI的情况下生成locusthtml文件?的全部内容。
THE END
分享
二维码
< <上一篇
下一篇>>