如何在没有UI的情况下生成蝗虫html文件

2024-05-23 07:58:05 发布

您现在位置:Python中文网/ 问答频道 /正文

如何在没有UI的情况下生成蝗虫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

与上述错误相同


Tags: 文件runpymastertrueuibasictime
1条回答
网友
1楼 · 发布于 2024-05-23 07:58:05

配置文件应该跟在所有的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

此外,还可以通过添加到cli生成html文件:

locust -f locustfile.py  headless -u 10 -r 10  run-time 15s  html=basicNew.html

顺便说一下,这是由于1.4.1版的蝗虫,它还没有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

相关问题 更多 >

    热门问题