Hocust如何使用dockercompose并获得聚合结果

2024-05-04 22:28:24 发布

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

我正在使用蝗虫运行负载测试。具体地说,我试图使用docker-compose,并遵循https://docs.locust.io/en/stable/running-locust-docker.html上的文档

我想按照https://docs.locust.io/en/stable/retrieving-stats.html中的方向以CSV格式检索测试统计数据 现在,当运行此设置时headless如何从所有工作人员获得CSV格式的聚合结果?非headless版本允许我将聚合结果作为CSV下载,但我不确定headless版本在这里是否有效。 谢谢


Tags: csvcomposedockerhttpsio版本docshtml
1条回答
网友
1楼 · 发布于 2024-05-04 22:28:24

您只需担心在master上运行 headless csv=example(如您链接到的文档页面所述)之类的操作。工人不需要这些,因为headless只适用于主节点,他们不聚合自己的结果。主控生成的CSV应包含所有工作人员的所有结果。如果您尝试了此操作,但没有看到所需的所有数据,则可能需要尝试添加 csv-full-history

从文档页面:

The files will be named example_stats.csv, example_failures.csv and example_history.csv (when using csv=example). The first two files will contain the stats and failures for the whole test run, with a row for every stats entry (URL endpoint) and an aggregated row. The example_history.csv will get new rows with the current (10 seconds sliding window) stats appended during the whole test run. By default only the Aggregate row is appended regularly to the history stats, but if Locust is started with the csv-full-history flag, a row for each stats entry (and the Aggregate) is appended every time the stats are written (once every 2 seconds by default).

相关问题 更多 >