[{"createTime":1735734952000,"id":1,"img":"hwy_ms_500_252.jpeg","link":"https://activity.huaweicloud.com/cps.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=V1g3MDY4NTY=&utm_medium=cps&utm_campaign=201905","name":"华为云秒杀","status":9,"txt":"华为云38元秒杀","type":1,"updateTime":1735747411000,"userId":3},{"createTime":1736173885000,"id":2,"img":"txy_480_300.png","link":"https://cloud.tencent.com/act/cps/redirect?redirect=1077&cps_key=edb15096bfff75effaaa8c8bb66138bd&from=console","name":"腾讯云秒杀","status":9,"txt":"腾讯云限量秒杀","type":1,"updateTime":1736173885000,"userId":3},{"createTime":1736177492000,"id":3,"img":"aly_251_140.png","link":"https://www.aliyun.com/minisite/goods?userCode=pwp8kmv3","memo":"","name":"阿里云","status":9,"txt":"阿里云2折起","type":1,"updateTime":1736177492000,"userId":3},{"createTime":1735660800000,"id":4,"img":"vultr_560_300.png","link":"https://www.vultr.com/?ref=9603742-8H","name":"Vultr","status":9,"txt":"Vultr送$100","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":5,"img":"jdy_663_320.jpg","link":"https://3.cn/2ay1-e5t","name":"京东云","status":9,"txt":"京东云特惠专区","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":6,"img":"new_ads.png","link":"https://www.iodraw.com/ads","name":"发布广告","status":9,"txt":"发布广告","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":7,"img":"yun_910_50.png","link":"https://activity.huaweicloud.com/discount_area_v5/index.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=aXhpYW95YW5nOA===&utm_medium=cps&utm_campaign=201905","name":"底部","status":9,"txt":"高性能云服务器2折起","type":2,"updateTime":1735660800000,"userId":3}]
1、元件
①测试计划:是Jmeter的起点,是其它Jmeter测试元件的容器
②线程组:代表一定数量的用户,它可以用来模拟用户并发发送请求
③配置元件:维护Sampler需要的配置信息,并根据实际的需要修改请求的内容
④前置处理器:在请求之前工作,常用来修改请求的设置
⑤定时器:用来定义请求之间的延迟间隔
⑥取样器(Sampler):是性能测试中向服务器发送请求,记录响应信息、响应时间的最小单元,如:HTTP Request Sampler、FTP
Request Sample、TCP Request Sample、JDBC Request Sampler等,每一种不同类型的sampler
可以根据设置的参数向服务器发出不同类型的请求
⑦后置处理器:负责在请求之后工作,常用获取返回的值
⑧断言:用来判断请求响应的结果是否符合期望
⑨监听器:负责收集测试结果,同时确定结果显示的方式
⑩逻辑控制器:可以自定义Jmeter发送请求的行为逻辑,它与Sampler结合使用可以模拟复杂的请求序列
2、Jmeter元件的作用域和执行顺序
2.1 元件作用域
配置元件:影响其作用范围内的所有元件
前置处理器:在其作用范围内的每一个sampler元件之前执行
定时器:在其作用范围内的每一个sampler有效
取样器:与其他元件产生交互没有作用域
逻辑控制器:各种控制器,如if、foeach等控制器。其本身只对其子节点的sampler有效
后置处理器:在其作用范围内的每一个sampler元件之后执行
断言:在其作用范围内的对每一个sampler元件执行后的结果进行校验
监听器:在其作用范围内对每一个sampler元件的信息收集并呈现
2.2 元件执行顺序:
配置元件->前置处理器->定时器->取样器->后置处理程序->断言->监听器