Jmeter logic controller operation, with chestnuts

jmeter logic controller determines the order of execution of the sampler. Right thread group -> Add -> logic controller.

 

A simple controller

Simple controller has no effect on how JMeter process which added to the sampler. Just help us do group name.

Example:

In the following program, the first to add a simple controller two requests: "Load Product Search Page" and "Search commodity A", and the controller is named "selection of merchandise"; add another two to the second simple controllers requests: "Add to cart" and "pay" and the controller name "payment operations." Run results can be seen, it does not affect the controller simply added thereto sampler.

 

Second, the loop controller

If the sampler is added to the loop controller or logic controller, in addition to the value specified for circulating thread group, the JMeter will be a certain number of cycles thereof. For example, if an HTTP request is added to the cycle count of cycles of the controller 2, and the thread group is set to 3 cycles, the total transmitting JMeter 2 * 3 = 6 HTTP requests.

Example:

Adding to set up a login request thread, and the thread group set number of cycles is 1. And adding a recharge request another cycle controller. We will cycle controller is configured to 5 cycles.

jmeter transmission request in the following order: login, recharge, recharge, recharge, recharge and recharge

 

Third, only one controller

Only one controller will always be performed during the first iteration of the loop any parent controller .

1) If a number in the specified number of cycles of the loop controller, then the controller will be performed only once only during the first iteration through the loop controller.

2) If the thread is placed in a group, no matter how many cycles a thread group setting, only during the first iteration of execution, that is performed only once.

Example:

1) thread group is a set number of cycles, only one cycle of the controller is placed in the controller, add a login request to the controller only once; charge request to add another cycle of the controller, is set to 5 cycles

jmeter transmission request in the following order: login, recharge, recharge, recharge, recharge and recharge

2) the controller in only one thread group, a login request to the controller only once added, the recharge request to add another thread group, the number of cycles is set the thread group 5

 

Fourth, the controller alternately

If you add the sampler logic controller or to an alternate controller, JMeter will alternate between each controller performs under each loop iteration.

忽略子控制器块及跨线程交替默认不选中,若选中,参见以下说明:

示例:

交替控制器置于线程组下,向线程组添加一个”加载商品搜索页面“请求,线程组循环次数设为4;向交替控制器添加两个请求:“搜索A商品”、“搜索B商品”

 

五、随机控制器

随机控制器的作用类似于交替控制器,不同在于它不是通过其子控制器和采样器按顺序排列,而是在随机选取一个。

示例:

随机控制器置于线程组下,向线程组添加一个”加载商品搜索页面“请求,线程组循环次数设为4;向随机控制器添加两个请求:“搜索A商品”、“搜索B商品”

运行之后,可以看到跟交替控制器的区别,每次通过该随机控制器下请求时随机取。

 

六、随机顺序控制器

随机顺序控制器类似简单控制器,区别在于该控制器下的节点请求执行顺序是随机的。

示例:

向随机顺序控制器中添加以下4个HTTP请求,运行后,可以看到该控制器下的4个HTTP请求顺序是随机的。

 

七:吞吐量控制器

吞吐量控制器作用:控制用户执行的频率。

有两种模式:

总执行次数(Total Executions): 设置运行次数

执行百分比(Percent Executions): 设置运行比例(1~100之间)

该控制器的其他元素说明,见下:

示例:

1)将吞吐量控制器1、吞吐量控制器2置于线程组下,线程组循环次数设置为5

2)吞吐量控制器1下选择Total Executions,吞吐量设为2;该控制器下的节点执行次数为2

3)吞吐量控制器2下选择Percent Executions,吞吐量设为60;该控制器下的节点执行次数=60%*线程组循环次数5=3次

运行结果:

 

八、Runtime Controller

控制其子节点运行多长时间。控制器将运行其子项,直到超出配置的运行时间。runtime为0时表示没有运行。

示例:

Runtime Controller置于线程组下,线程组循环次数默认1,Runtime Controller的runtime设为3s

只运行了3s停止了。

 

Guess you like

Origin www.cnblogs.com/tudou-22/p/10983439.html