转载南风_real博客园:http://www.cnblogs.com/jaychang/p/5784882.html

首先上效果图:

其次明白几个原理:

  1. 90% Line的意思是:一组数由小到大进行排列,找到它的第90%个数;
  2. Jmeter html报告生成是使用xxx.jtl文件通过xsl模板生成的,因此要在html报告中显示90% line,就需要修改xsl模板文件(jmeter-results-detail-report_21.xsl)

最后上步骤:
1、在jmeter-results-detail-report_21.xsl添加xsl template,可以放在max template模板下面,如下

<!-- 90% line time -->
<xsl:template name="lineTime">
<xsl:param name="nodes" select="/.." />
<xsl:choose>
<xsl:when test="not($nodes)">NaN</xsl:when>
<xsl:otherwise>
<xsl:for-each select="$nodes">
<xsl:sort data-type="number" />
<!-- last() 返回当前上下文中的最后一个节点位置数 -->
<!-- floor(number) 返回不大于number的最大整数 -->
<!-- position() 返回当前节点位置的数字 -->
<!-- number(object) 使对象转换成数字 -->
<xsl:if test="position() = floor(last()*0.9)">
<xsl:value-of select="number(.)" />
</xsl:if>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

2、在Summary中添加90% Line

<xsl:template name="summary">
<h2>Summary</h2>
<table align="center" class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
<tr valign="top">
<th># Samples</th>
...省略N行,添加总结框中的90% Line标题...
<th>90% Line</th>
</tr>
...省略N行,添加一个xsl变量...
<!-- New add 90% line -->
<xsl:variable name="allLineTime">
<xsl:call-template name="lineTime">
<xsl:with-param name="nodes" select="/testResults/*/@t" />
</xsl:call-template>
</xsl:variable> ...省略N行,在表格中显示数字...
<td align="center">
<xsl:call-template name="display-time">
<xsl:with-param name="value" select="$allLineTime" />
</xsl:call-template>
</td>

3、在pagelist中添加90% Line

<xsl:template name="pagelist">
<h2>Pages</h2>
<table align="center" class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
<tr valign="top">
<th>URL</th>
...省略N行,添加Pages中的90% Line标题...
<th>90% Line</th>
<th></th>
...省略N行,添加一个xsl变量...
<!-- new add 90% line time -->
<xsl:variable name="nintyTime">
<xsl:call-template name="lineTime">
<xsl:with-param name="nodes" select="../*[@lb = current()/@lb]/@t" />
</xsl:call-template>
</xsl:variable>
...在表格中显示数字...
<td align="center">
<xsl:call-template name="display-time">
<xsl:with-param name="value" select="$nintyTime" />
</xsl:call-template>
</td>

Jmeter html 报告中添加90% line time的更多相关文章

  1. jmeter+ant+jenkins+mac报告优化(二):添加90% Line和QPS

    一.优化内容 1.Summary中只标红Failures数 2.Pages页面按Average Time倒序排序 3.Average Time超过2s标黄显示 4.Pagelist 模块中针对错误和超 ...

  2. Jmeter+Jenkins的HTML报告中添加QPS、90%栏目显示

    1.进入jmeter/extras目录,修改 jmeter-results-detail-report_21.xsl   2.打开文件 在summary部分修改如下: 在pagelist部分修改如下: ...

  3. Jmeter+Jenkins的聚合报告中添加QPS栏目显示

    1.进入jmeter/extras目录,修改 jmeter-results-detail-report_21.xsl   2.打开文件修改 如上所示,在文件中添加6个地方关于QPS的显示即可, 然后替 ...

  4. JMeter专题系列(七)聚合报告之 90% Line

    JMeter 官网原文: 90% Line - 90% of the samples took no more than this time. The remaining samples at lea ...

  5. Jmeter Html 报告优化

    转载自南风_real博客园:http://www.cnblogs.com/jaychang/p/5881525.html 但是最近在查阅相关资料时,发现基本都是重复一篇文章Jmeter使用笔记之htm ...

  6. Jmeter 请求参数中包含 MD5 加密的密码

    如何在jmeter中对参数进行加密 使用工具:java+myeclipse 让开发将他的加密类从eclipse中导出来打成jar包,放在jmeter安装文件夹lib文件夹中%JMETER HOME%\ ...

  7. JMeter 聚合报告之 90% Line 参数说明

    其实要说明这个参数的含义非常简单,可能你早就知道他的含义,但我对这个参数一直有误解,而且还一直以为是"真理",原于一次面试,被问到了这个问题,所以引起我这个参数的重新认识. 先说说 ...

  8. JMeter笔记3:聚合报告之90%Line参数说明

    看看JMeter 官网是怎么说的? 90% Line - 90% of the samples took no more than this time. The remaining samples a ...

  9. JMeter学习(七)聚合报告之 90% Line 正确理解(转载)

    转载自 http://www.cnblogs.com/yangxia-test 90% Line 参数正确的含义: 虽然,我的上面理解有一定的道理,显然它是错误的.那看看JMeter 官网是怎么说的? ...

随机推荐

  1. 在EDIUS中调整素材颜色的方法

    EDIUS是一款非线性编辑软件,有很强大的视频剪辑功能,很受学习视频剪辑的同学欢迎.本EDIUS教程今天的主要目的就是分享自己学习经验写了一篇EDIUS入门教程文章,希望能给学习EDIUS的小伙伴带来 ...

  2. 在Windows上安装Maven

      下载 Maven 最新版本. http://maven.apache.org/download.cgi   1,下载包后,解压到相应特定位置. 2,将 [解压位置]/bin  加入到Path 3, ...

  3. SqlServer中日期和时间数据类型及函数 【转】

    来源:http://blog.csdn.net/royalwzy/article/details/6446075 日期和时间数据类型 下表列出了 Transact-SQL 的日期和时间数据类型. 数据 ...

  4. nginx-gridfs使用

    安装nginx及nginx-gridfs 依赖库.工具   # yum -y install pcre-devel openssl-devel zlib-devel # yum -y install ...

  5. How to send Email using C#

    try { MailMessage mail = new MailMessage(); SmtpClient SmtpServer = new SmtpClient("smtp.gmail. ...

  6. typeof和instanceof运算符

    (1)typeof运算符用于判断某一个变量的数据类型,它可以作为函数来用,如typeof(a)可以返回变量a的数据类型:也可以作为一个运算符来使用,例如typeof a 也可以返回变量a的数据类型,不 ...

  7. Activation successful 数据库邮件无法发送

    问题现象: 配置好数据库邮件后发送测试邮件. 在数据库邮件发送日志中显示状态为:Activation successful.而邮件是无法收到的. 解决方法: 本次解决是将SQL Server Agen ...

  8. bash{} 方法总结

    假设我们定义了一个变量为: file=/dir1/dir2/dir3/my.file.txt 我们可以用 ${ } 分别替换获得不同的值: ${file#*/}:拿掉第一条 / 及其左边的字串:dir ...

  9. NFC会员管理-转载自http://technews.cn/2014/09/13/nfc-sticker/

    基隆的百年名店“李鹄饼店”误用馊水油,客人纷纷上门退货,因退货条件宽松,客人一货两退,造成巨大的损失.为了平息客人的愤怒,店家允许客人凭发 票或商品办理退货,有的客人先用发票退一次钱,再用商品退一次钱 ...

  10. elasticsearch 跨网段组集群

    elasticsearch 是非常流行的全文搜索引擎,但网上的教程多是初次使用,并没有一些高级用法demo.这次遇到需要跨网段组网问题,自己摸索了文档很久,发现确实可行,于是着手做了个实验,最终实验成 ...