转载南风_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. A Flock Of Tasty Sources On How To Start Learning High Scalability

    This is a guest repost by Leandro Moreira. When we usually are interested about scalability we look ...

  2. c# webBrowser控件与js的交互

    转自:http://blog.csdn.net/sd2131512/article/details/7467564 [System.Runtime.InteropServices.ComVisible ...

  3. axure变量的使用

    1.什么是变量? 变量在数学中的定义是可以改变的数,在计算机编程中,它是在内存中开辟的一块空间用于存储临时 数据.Axure中的变量和计算机编程中一样,它是一个用于存储临时数据的容器. 2.变量的创建 ...

  4. Q6: Binary Tree Preorder Traversal

    问题描述 Given a binary tree, return the preorder traversal of its nodes' values. For example:Given bina ...

  5. Openjudge计算概论——数组逆序重放【递归练习】

    /*===================================== 数组逆序重放 总时间限制:1000ms 内存限制:65536kB 描述 将一个数组中的值按逆序重新存放. 例如,原来的顺 ...

  6. html初学(三)

    <!-- 我就是我,不一样的烟花 piu piu piu 干啥子 如来神掌 -- --- ----- .======. ***********啊啊啊啊啊啊 | INRI | | | | | .= ...

  7. 高效能团队协作的JIRA实践

    http://www.csdn.net/article/2015-05-21/2824739?utm_source=tuicool 高效能团队是企业生存和发展的基石.任何企业面对当下的激烈竞争,要想脱 ...

  8. XAMPP 在windows下无法启动Apache解决方案

    XAMPP 在windows下无法启动Apache解决方案 一.现象 XAMPP 点击Start Apache时出现如下错误 20:41:12  [Apache] Error: Apache shut ...

  9. 【linux】wc命令

    Linux系统中的wc(Word Count)命令的功能为统计指定文件中的字节数.字数.行数,并将统计结果显示输出. 1.命令格式: wc [选项][文件] 2.命令参数: -c char统计字节数. ...

  10. 51nod 1314 定位系统

    一个国家有N个城市(标号为0~N-1),这N个城市恰好由N-1条道路连接在一起(即N个城市正好构成一个树状结构).这个国家的所有道路的长度都是1个长度单位.定义:两个城市间的距离是两个城市间的最短路的 ...