很多人用jmeter做性能测试,但是很少有人理解90%line和95%line参数的含义。大多数人理解为
90%
用户的平均响应时间和
95%
用户的平均响应时间.好像很有道理,但是实际是错误的。
1、官网文档说明:
我们来看看官网的帮助文档里是怎么说的:
Average - The average time of a set of results
90% Line - 90% of the samples took no more than this time. The remaining samples took at least as long as this.
95% Line - 95% of the samples took no more than this time. The remaining samples took at least as long as this
99% Line - 99% of the samples took no more than this time. The remaining samples took at least as long as this
翻译过来:
Average:结果的平均响应时间
90% Line :90%的请求小于这个时间
95% Line :95%的请求小于这个时间
99% Line:99%的请求小于这个时间
当然这几个值的单位是毫秒。
2、正确理解:
假如:
有10个数:
1、2、3、4、5、6、7、8、9、10 按由大到小将其排列。
求它的第90%百分位,也就是第9个数刚好是9 ,那么他的90%Line 就是9 。
另一组数:
2、2.1、2.5、3、3.4、3.4、4、4、4、4、5、5、5、5.9、5.91、6.8、8、12、24、24.1 按由大到小将其排列。
求它的第90%百分位,第18个数是12 么,他的90%Line 就是12。
3、总结:
正确理解Average、90% Line、95% Line 、99% Line有助于我们正确的分析测试报告,判断系统瓶颈。
而jmeter是采用中位数,而不是采用平均数