【问题标题】:how to generate locust html file without UI?如何在没有 UI 的情况下生成 locust html 文件?
【发布时间】:2021-03-11 08:28:05
【问题描述】:

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

与上述相同的错误。

【问题讨论】:

  • 你如何运行你的蝗虫?你试过吗? locust -f locustfile.py --headless -u 10 -r 10 --run-time 15s --html=basicNew.html
  • 是否应该在 expected-workers=4 行之后出现 'master' 行?

标签: python performance-testing locust


【解决方案1】:

配置文件应遵循所有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版本的locust,还没有html报告。仅从 1.4.2 开始添加:

1.4.2 对图表的多项改进,包括工具提示等添加了 -html 选项以保存 HTML 报告 docs.locust.io/en/stable/changelog.html#id3很多其他小 修复。

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

【讨论】:

  • 我更新了帖子,同样的错误。请检查编辑部分。
  • @VidyVideni 这是由于 1.4.1 版本的蝗虫,它还没有 HTML 报告。仅在 1.4.2 中添加: 1.4.2 对图表的多项改进,包括工具提示等 添加 -html 选项以保存 HTML 报告 docs.locust.io/en/stable/changelog.html#id3 许多其他小修复。尝试将版本更新到 1.4.2 或最新的 1.4.3
猜你喜欢
  • 2016-04-20
  • 2015-01-04
  • 2019-09-14
  • 1970-01-01
  • 2011-02-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多