jmeter测试报告美化实战案例
原创
久曲健2020-11-27 20:39:59©著作权
文章标签
java
阅读数
269
©著作权归作者所有:来自51CTO博客作者久曲健的原创作品,如需转载,请注明出处,否则将追究法律责任
https://blog.51cto.com/u_15009374/2555781
jmeter测试报告美化实战案例
![](https://s4.51cto.com/images/blog/202011/27/dc0620baa54f95b7c38e989064d0b5b3.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)
作者:糖小幽
![](https://s4.51cto.com/images/blog/202011/27/45683db243c5dc2ea75a7051433cbde9.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)
JMeter3.0引入了Dashboard Report,用于生成HTML页面格式图形化报告的扩展模块。
该模块支持通过两种方式生成多维度图形化测试报告:
1、在JMeter性能测试结束时,自动生成本次测试的HTML图形化报告
2、使用一个已有的结果文件(如CSV文件)来生成对应结果的HTML图形化报告
**注意:**
3.0直接生成报告会出现乱码,建议下载3.1之后的版本,我这里下载的是最新的3.2
那么如何生成这种高大上的报告?
**看完之后,记得收藏+转发。**
**如何操作:**
从cmd进入执行测试文件,
基本命令格式:
-----
jmeter -n -t -l -e -o 示例:
![](https://s4.51cto.com/images/blog/202011/27/9d8d78742f5435bcc1ef6a687dfc3934.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)
执行完成后会在\apache-jmeter-3.2\bin\output目录下产生如下文件(夹):
![](https://s4.51cto.com/images/blog/202011/27/bc8653cdcbdb423f4ddbf049805ae7ee.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)
打开index.html文件,就可以查看各种图形化报告:
![](https://s4.51cto.com/images/blog/202011/27/98629949b3c63d6fcd64f7c8ebeeabf1.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)
如果需要从已有的结果文件CSV生成html报告,则需要配置
jmeter.properties:
-----
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
如果希望在Errors报告中展示更详细数据
需要确保如下配置
-----
jmeter.save.saveservice.assertion_results_failure_message = true
如果使用了事务控制器(Transaction Controller),确认Generate parent sample为未勾选状态,使用已有的CSV日志文件生成报告
基本命令格式:
-----
jmeter -g -o **示例:**
![](https://s4.51cto.com/images/blog/202011/27/82746c40e207866c1055ec320ace496a.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)
更多资料,请查看官方Dashboard Report说明...
· 猜你喜欢的文章 ·
赞
收藏
评论