参考:http://jmeter.apache.org/usermanual/generating-dashboard.html
JMeter 3.x开始,可以生成HTML格式的report 。
注意这里一定要是JMeter 3.x 版本。我之前是 JMeter 2.x版本,一直找不到相应的命令行。换到JMeter 3.2版本就好啦。
相关命令参数说明
-g, --reportonly <argument> generate report dashboard only, from a test results file //从取样结果文件直接生成 report dashboard -e, --reportatendofloadtests generate report dashboard after load test //测试之后生成report dashboard -o, --reportoutputfolder <argument> output folder for report dashboard //定义report dashboard文件路径
测试过程中生成 dashboard
命令:
jmeter -n -t myTP.jmx -l a.csv -e -o myDashboard
注意:
1. 这里一定要使用 –l参数,首先生成 csv取样文件。然后才可以生成 dashboard。
2.需要同时使用 –e 和 –o。
3. 生成的myDashboard是一个文件夹,里面包含如下文件。双击 Index.html 用浏览器打开即可。
由CSV取样结果直接生成dashboard
命令:
jmeter -g a.csv -o myDashboard
这里 –g 后边跟 测试过程中生成的取样结果文件。
-o后边定义dashboard输出路径。
Dashboard 展示
生成文件包含一个总体的Dashboard,以及其他常用的图表。
Dashboard:
针对具体的图表,还可以保存为PNG图片。
作者:
微微微笑
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利.
14.2.1 Requirements
To enable the generator to operate, the input CSV files must include certain required data. Check that your JMeter configuration follows these settings (these are the defaults):
jmeter.save.saveservice.bytes = true # Only available with HttpClient4 #jmeter.save.saveservice.sent_bytes=true jmeter.save.saveservice.label = true jmeter.save.saveservice.latency = true jmeter.save.saveservice.response_code = true jmeter.save.saveservice.response_message = true jmeter.save.saveservice.successful = true jmeter.save.saveservice.thread_counts = true jmeter.save.saveservice.thread_name = true jmeter.save.saveservice.time = true jmeter.save.saveservice.connect_time = true # the timestamp format must include the time and should include the date. # For example the default, which is milliseconds since the epoch: jmeter.save.saveservice.timestamp_format = ms # Or the following would also be suitable jmeter.save.saveservice.timestamp_format = yyyy/MM/dd HH:mm:ss
The input CSV file must include the timeStamp
To ensure most accurate results, if you use a transaction controller, uncheck the box:
Generate parent sample

The "
Errors" summary table shows more accurate data if these settings are fulfilled:
When using JMeter distributed mode with multiple jmeter-server instances, ensure you add in your Thread Groups something that uniquely identifies ThreadGroup for every JVM, example:
ThreadXXX_${__P(JVM_ID)}where you pass a different JVM_ID property for each jmeter-server through:
-JJVM_ID=iwhere i varies between 1 and the number of jmeter-server you are using.