Cherishyuu 2020-01-11
*JMeter4.0 开始无需修改配置文件了,可以直接跳过第一步,直接用命令生成报告。
*JMeter3.1~5.1 汉化文件通用,需要者可以直接下载覆盖即可。
--以下为原文-------------------------------------------------------------------------------------------------------
Jmeter3.0开始就有这个新特性了,详情见官网
http://jmeter.apache.org/usermanual/generating-dashboard.html
*建议下载Jmeter3.1版本,因为Ver3.0由于编码问题报告中的中文会显示成乱码。官方在Ver3.1修复了这个问题。
1. 修改配置文件
在\bin\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
如果需要显示更多错误信息,做如下修改
jmeter.save.saveservice.assertion_results_failure_message = true
2. 生成报告
根据.jmx文件 执行并生成报告
jmeter -n -t 脚本.jmx -l 记录.jtl -e -o ./Report
根据.jtl文件 生成报告
jmeter -g 记录.jtl -o ./Report
3. 报告
原文链接:https://blog.csdn.net/tomoya_chen/article/details/56481479