目录
保存响应到文件Save Responses to a file
Active Threads Over Time活动线程曲线
监听器比较耗费测试机资源,越少越好
聚合报告
聚合报告参数详解:
1. Label:每个 JMeter 的 element(例如 HTTP Request)都有一个 Name 属性,这里显示的就是 Name 属性的值
2. #Samples:请求数——表示这次测试中一共发出了多少个请求,如果模拟10个用户,每个用户迭代10次,那么这里显示100
3. Average:平均响应时间——默认情况下是单个 Request 的平均响应时间,当使用了 Transaction Controller 时,以Transaction 为单位显示平均响应时间
4. Median:中位数,也就是 50% 用户的响应时间
---------------------------------------------------------------------
5. 90% Line:90% 用户的响应时间:
一组数由小到大进行排列,找到他的第90%个数(假如是12),那么这个数组中有90%的数将小于等于12 。
用在性能测试的响应时间,也就是90%请求响应时间不会超过12 秒。
例如:
某一次测试结果,每个sample的响应时间分别是:1、3、4、9、2、8、5、7、6、10,将其按由小到大将其排列为:
1、2、3、4、5、6、7、8、9、10
那么它的第90%百分位,也就是第9个数刚好是9 ,那么他的90%Line 就是9 。即90%响应时间是9ms,理解为:90%的用户请求时间不冲9ms。
另一测试结果,20个sample,响应时间分别为:
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。
---------------------------------------------------------------------
6. Min:最小响应时间
7. Max:最大响应时间
8. Error%:错误率——错误请求数/请求总数
9. Throughput:吞吐量——默认情况下表示每秒完成的请求数(Request per Second),当使用了 Transaction Controller 时,也可以表示类似 LoadRunner 的 Transaction per Second 数
10. KB/Sec:每秒从服务器端接收到的数据总量,相当于LoadRunner中的Throughput/Sec
一般而言,性能测试中我们需要重点关注的数据有: #Samples 请求数,Average 平均响应时间,Min 最小响应时间,Max 最大响应时间,Error% 错误率及Throughput 吞吐量。
汇总报告
Avg.Bytes平均字节数:所有取样器返回的respond data字节数平均值,即平均单个取样器单次的返回数据量;大致上Throughput*Avg.Bytes=Received KB/s
查看结果树
结果树可以查看取样器的执行结果,包括请求及响应数据
Load time:即Elapsed time,响应时间。从开始发送请求到接收完响应数据的时间
Connect Time:建立连接的时间
Latency:从开始发送请求到接收完第一个响应字节的时间。Latency包括Connect Time?
登录线程1-1:第一个1为编号1的线程组,第二个1即为编号1的线程
官方原文:
Elapsed time. JMeter measures the elapsed time from just before sending the request to just after the last response has been received. JMeter does not include the time needed to render the response, nor does JMeter process any client code, for example Javascript.
Connect Time. JMeter measures the time it took to establish the connection, including SSL handshake. Note that connect time is not automatically subtracted from latency. In case of connection error, the metric will be equal to the time it took to face the error, for example in case of Timeout, it should be equal to connection timeout.
Latency. JMeter measures the latency from just before sending the request to just after the first response has been received. Thus the time includes all the processing needed to assemble the request as well as assembling the first part of the response, which in general will be longer than one byte. Protocol analysers (such as Wireshark) measure the time when bytes are actually sent/received over the interface. The JMeter time should be closer to that which is experienced by a browser or other application client.
Json path tester可以调试json数据:
保存响应到文件Save Responses to a file
可将响应数据写入本地文件,默认在安装目录\bin\之下
*导出的文件内容格式参考CSV数据配置文件目录
后端监听器
将执行结果数据发送至后端数据库平台
Influxdb监听+Grafana可视化:
需要在Linux平台搭建好influxdb和Grafana,原理是jmeter把结果数据传给influxdb,Grafana再获取influxdb的数据进行可视化
Jmeter配置:
influxdbUrl:填写influxdb的地址
Application:自定义填写应用名称,此值也作为名为“application”的标记存储在“events”中
summaryOnly:true则只输出整体结果,false可以输出各个sample的结果
testTitle:自定义填写测试标题。该值作为名为“text”的字段存储在“事件”度量中。 JMeter在测试的开始和结束时自动生成一个注释,其值以'started'和'ended'结尾
percentiles:要发送到后端的百分位数,多个值以;分割
TAG_WhatEverYouWant:自定义标签。您可以根据需要添加任意数量的自定义标签。对于它们中的每一个,只需创建一个新行并在其名称前加“TAG_”
下面二图为summaryOnly=true的结果,图一为influxdb查询界面,图二为Grafana界面:
下面二图为summaryOnly=false的结果:
用表格查看结果
可以清晰比较请求时间及数据大小的表格
Active Threads Over Time活动线程曲线
可以查看活动线程数
如图梯度线程组设置如下:
可以看到活动线程曲线和线程组的配置一致: