JMeter:十三:生成 report dashboard

本文介绍如何使用JMeter 3.x版本通过命令行生成HTML格式的测试报告。包括从采样结果文件直接生成报告的方法及注意事项。

参考: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 用浏览器打开即可。

image

由CSV取样结果直接生成dashboard

命令:

jmeter -g a.csv -o myDashboard

这里 –g 后边跟 测试过程中生成的取样结果文件。

-o后边定义dashboard输出路径。

Dashboard 展示

生成文件包含一个总体的Dashboard,以及其他常用的图表。

 

image

Dashboard:

针对具体的图表,还可以保存为PNG图片。

image

作者: 微微微笑
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利.


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:
  • jmeter.save.saveservice.assertion_results_failure_message = true
  • If you use a transaction controller, uncheck the box Generate parent sample
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=i
where  i varies between 1 and the number of jmeter-server you are using.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值