python - 如何生成没有UI的locust html文件?

标签 python performance-testing locust

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

相关文章:

python - 将列表项转换为定义的数据类型

python - 从 python 2 到 python 3 的 create_string_buffer 和 string.join 错误

c++ - 什么样的数据结构适合facebook模型的用户

kubernetes - 在 Kubernetes 中运行 Locust 时出现无法从 'HttpUser' 错误导入名称 'locust'

python - 当运行locust --master和client locust --master-host时,locust不能运行api压力,为什么?

python - sqlalchemy func.json_build_object 抛出错误,无法确定参数的数据类型

面向零售商/分销商的 Python 网上商店

持续集成中的 Java 分析

python - 使用 scipy 的各种稀疏矩阵乘积的性能

python - 为 Python LocustIO 格式化 Json