吞吐量控制器的目的? [英] Purpose of Throughput Controller?
问题描述
我需要一些帮助来使用JMeter.我想记录两种不同的情况,例如单击2个不同的按钮.如果我尝试为2个用户运行,则一个用户应按第一个按钮,另一个用户应同时按另一个按钮.
I need some help to use JMeter. I want to record two different scenarios like clicking 2 different buttons. If i try to run for 2 users, one user should hit first button, another should hit another button concurrently.
我知道这是基本问题.但是我是这个新手.那就是为什么在这里问.我尝试过如下所示:
I know this is the basic question. But i am new to this one. Thats why asking here. I have tried like below:
Thread Group
-Throughput Controller
--Login
--Clicking 1st button
-Throughput controller
--Login
--Clicking 2nd button
当我使用CSV数据集配置与2个用户一起运行时,两个登录名都使用同一用户.
When i run with 2 users using CSV Data Set Config, both login takes same user.
而且我还需要测试并发性.我不确定如何正确执行此操作.有人可以帮我吗?
And also i need to test for concurrency. I am not sure how to execute this one correctly. Could anyone can help me in this?
推荐答案
-
如果有多个迭代,则吞吐量控制器将正常工作.
IE.您应该有N个回路(例如使用回路控制器),其子吞吐量控制器设置为X百分比(X为整数,0< = X< = 100)-因此N个回路中的X%也是整数值.
您可以查看此讨论以获得更好的示例和解释.
Throughput Controller will work correct if you have more than single iteration.
I.e. you should have N loops (using Loop Controller e.g.) with child Throughput Controller set X percents (X is integer, 0 <= X <= 100) - so than X% from N loops is integer value too.
You may look into this discussion for better examples and explanations.
对于您的情况,您可以尝试使用以下结构:
For your case you can try to use construction like the following:
Thread Group
Number of Threads = 2
Loop Count = 1
+- While Controller
Condition = ${__javaScript("${login}"!="<EOF>",)}
+- CSV Data Set Config
Filename = users.csv
Variable Names = login,pwd
Delimiter = ,
+- Loop Controller
Loop Count = 10
+- Login
+- Throughput Controller
Percent Execution
Throughput = 50.0
+- Clicking 1st button
+- Throughput Controller
Percent Execution
Throughput = 50.0
+- Clicking 2nd button
+- Logout
其中
-有2个线程(线程组:线程数= 2)同时启动,每个线程都具有从csv文件(同时使用Controller + CSV数据集配置)提取的唯一凭据进行登录;
-整个测试流程-登录>单击按钮(第一次或第二次)>注销-将使用循环控制器重复N次,这使吞吐量控制器正常工作.
where
- there are 2 threads (Thread Group: Number of Threads = 2) started simultaneously each with unique credentials extracted from csv-file (While Controller + CSV Data Set Config), used for Login;
- the whole test-flow - login > click button (either first or second) > logout - will be repeated N times using Loop Controller, which one makes Throughput Controller work.
这篇关于吞吐量控制器的目的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!