转载南风_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. Oracle数据库—— PL/SQL基础编程

    一.涉及内容 1. 掌握PL/SQL程序块的结构,理解并熟悉各种变量的应用. 二.具体操作 (一)使用system用户登录SQL*PLUS,使用SQL语句创建用户:u_你的姓名首字母(例如:u_zs) ...

  2. 【转】SVN的UUID错误

    操作TortoiseSVN时,报如下错误:       Command Update       Repository UUID '62b86956-73d9-2945-ba87-0546d71898 ...

  3. CSS之background属性

    css背景是个很有意思的东西,可设置 背景色:background-color 背景图:backgoround-image 背景图显示相对位置:background-position,正数图片往右下移 ...

  4. android 如何让文本中某个关键字高亮显示?

    TextView tv = (TextView) findViewById(R.id.hello);SpannableString s = new SpannableString(getResourc ...

  5. java中的包装类与装箱拆箱定义

    JAVA 中int类型转String类型的通常方法,有三种:  1.String.valueOf(int i)  2.Integer.toString(int i)  3.i+"" ...

  6. 编译工程时报illegal character:\65279--转

    windows对UTF-8文件进行了特殊处理,对UTF-8的文本文件自动在前面加了三个byte(EF BB BF),javac编译时,读到最前面这三个byte时报错 illegal character ...

  7. MySQL explain key_len 大小的计算

    总结: 变长字段需要额外的2个字节,固定长度字段不需要额外的字节.而null都需要1个字节的额外空间,所以以前有个说法:索引字段最好不要为NULL,因为NULL让统计更加复杂,并且需要额外一个字节的存 ...

  8. HTML5新事物

    1 指定编码字符集,极力推荐 <meta charset="utf-8"> 2 指定lang,所有的标签上都有,推荐在<html>上指定. 3 css样式的 ...

  9. LintCode "Max Tree"

    Something new I learnt from it: what is Treap and a O(n) construction https://en.wikipedia.org/wiki/ ...

  10. 剑指offer系列56---连续子数组的最大和

    [题目]输入一个整型数组,数组里有正数也有负数.数组中一个或连续多个整数组成一个子数组. * 求所有子数组和的最大值. * [思路]连续求和数组元素.一旦得到的和小于0,就抛弃前面的数组,从当前值重写 ...