热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

Jmeterreport优化

优化大致过程

生成并的报告模板:



    public="-//W3C//DTD HTML 4.01 Transitional//EN" doctype-system="http://www.w3.org/TR/html4/loose.dtd"/>
    
    
        
        
            
            
            
            
        
        
            
    for-each select="*"> if test="position() = 1 or @tn != preceding-sibling::*[1]/@tn">
  1. class="navigation">Thread:
  2. if>
  3. success failure
    class="detail">
    class="group">Sampler
    class="zebra">
    class="data key">Thread Nameclass="data delimiter">:class="data">
    class="data key">Timestampclass="data delimiter">:class="data">class="patch_timestamp">
    class="data key">Timeclass="data delimiter">:class="data"> ms
    class="data key">Latencyclass="data delimiter">:class="data"> ms
    class="data key">Bytesclass="data delimiter">:class="data">
    class="data key">Sample Countclass="data delimiter">:class="data">
    class="data key">Error Countclass="data delimiter">:class="data">
    class="data key">Response Codeclass="data delimiter">:class="data">
    class="data key">Response Messageclass="data delimiter">:class="data">
    class="trail">
    if test="count(assertionResult) > 0">
    class="group">Assertion
    class="zebra"> for-each select="assertionResult"> failure failure for-each>
    class="data assertion" colspan="3">
    class="data key">Failureclass="data delimiter">:class="data">
    class="data key">Errorclass="data delimiter">:class="data">
    class="data key">Failure Messageclass="data delimiter">:class="data">
    class="trail">
    if>
    class="group">Request
    class="zebra">
    class="data key">Method/Urlclass="data delimiter">:class="data">
    class="data"> 
    class="data key">Query Stringclass="data delimiter">:class="data">
    class="data">
    class="data key">COOKIEsclass="data delimiter">:class="data">
    class="data">
    class="data key">Request Headersclass="data delimiter">:class="data">
    class="data">
    class="trail">
    class="group">Response
    class="zebra">
    class="data key">Response Headersclass="data delimiter">:class="data">
    class="data">
    class="data key">Response Dataclass="data delimiter">:class="data">
    class="data">
    class="data key">Response Fileclass="data delimiter">:class="data">
    class="data">
    class="trail">
  4. for-each>
View Code

报模拟放到jmeter_home/extras

 

1、修改jmeter.properties文件,打开一些输出内容开关(下图根据需要选择相关项,具体就不用多说了吧) 
jmeter.save.saveservice.assertion_results=none
#
jmeter.save.saveservice.data_type=true
jmeter.save.saveservice.label=true
jmeter.save.saveservice.response_code=true
# response_data is not currently supported for CSV output
jmeter.save.saveservice.response_data=true
# Save ResponseData for failed samples
jmeter.save.saveservice.response_data.on_error=true
jmeter.save.saveservice.response_message=true
jmeter.save.saveservice.successful=true
jmeter.save.saveservice.thread_name=true
jmeter.save.saveservice.time=true
jmeter.save.saveservice.subresults=true
jmeter.save.saveservice.assertions=true
jmeter.save.saveservice.latency=true
# Only available with HttpClient4
jmeter.save.saveservice.connect_time=false
jmeter.save.saveservice.samplerData=false
jmeter.save.saveservice.responseHeaders=false
jmeter.save.saveservice.requestHeaders=false
jmeter.save.saveservice.encoding=false
jmeter.save.saveservice.bytes=true
# Only available with HttpClient4
jmeter.save.saveservice.sent_bytes=true
jmeter.save.saveservice.url=true
jmeter.save.saveservice.filename=false
jmeter.save.saveservice.hostname=false
jmeter.save.saveservice.thread_counts=true
jmeter.save.saveservice.sample_count=false
jmeter.save.saveservice.idle_time=false
View Code
2、制定一份自己的输出模板。(不用默认的jmeter_home/extras/jmeter-results-detail-report.xsl模板,也可以网上自己找份。)
3、最后执行,生成对应的HTML报告(一般我们都在linux环境 下运行,语句大致如下,其中my_project_template.xsl就上第2步说的定制模板,这个是网上找的一份。)

xsltproc $jmeter_home/extras/my_project_template.xsl $my_project_workspace/result/jtl/$test_name/${test_name}.jtl > $my_project_workspace/result/html/$test_name/${test_name}.html

最后报告如下:

 

Jmeter report优化
 

 

优化后的HTML报告,多了接口地址、接口参数、Headers信息(包括COOKIE、session),而且有返回结果。失败原因一目了然

推荐阅读
author-avatar
手机用户2502903761
这个家伙很懒,什么也没留下!
Tags | 热门标签
RankList | 热门文章
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有