如何使用命令提示符将 JMeter 聚合报告结果保存到 CSV 文件? [英] How to save JMeter Aggregate Report results to a CSV file using command prompt?
问题描述
我一直在 GUI 模式下使用 JMeter 来编写负载测试我的服务所需的所有测试用例,但对于实际测试,我需要在非 GUI 模式下执行测试.如何使用命令提示符将汇总报告的结果保存在 csv 文件中.
I have been using JMeter in GUI mode for composing all the test cases required for load testing my service but for actual testing I need to execute tests in non-GUI mode. How do I save the results of Aggregate report in csv file using command-prompt.
提前致谢.
推荐答案
作为替代方案:您可以直接从 Aggregate Report 侦听器执行此操作.
Just as alternative: you may do this directly from the Aggregate Report listener.
1. 设置结果文件的文件名/模板:
1. set filename/template for results file:
resultsFile = ${__property(user.dir)}${__BeanShell(File.separator,)}result_${__time(yyyyMMdd-HHmmss)}.csv
2. 配置聚合报告监听器,如下所示:
2. configure Aggregate Report listener as shown below:
在这种情况下生成的 CSV 文件将不同于通过 GUI/保存表数据"生成的文件.
如果不可接受,您最好将方法与先前答案中的 JMeterPluginsCMD 结合使用:
CSV-file generated in this case will differ from generated via GUI/"Save Table Data" one.
If it is not acceptable you'll better use method with JMeterPluginsCMD from previous answer:
java -jar JMeterPluginsCMD.jar --generate-csv aggregateResults.csv --input-jtl testResults.jtl --plugin-type AggregateReport
这篇关于如何使用命令提示符将 JMeter 聚合报告结果保存到 CSV 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!