Jmeter -- 循环控制器和线程并发(关注执行顺序)

时间:2024-03-12 12:28:06

测试计划中包含两个线程组,分别设置如下:

线程组1:线程数为2,循环次数为4

线程组2:线程数为4

 

执行顺序

监听器View Results in Table(用表格查看结果)中,ThreadName列,n-m,其中n指线程组号,m指线程号
例如:1-1,指第一个线程组中的第一个线程
     1-2,指第一个线程组中的第二个线程
     2-1,指第二个线程组中的第一个线程
     2-4,指第二个线程组中的第四个线程
每个线程下的请求,按顺序执行,有循环的在循环内按顺序执行

 

两个线程组都有四个请求,请求执行顺序如下:

 线程组1:第一个线程-》循环n次,第二个线程-》循环n次

 线程组2:第一个线程-》按顺序执行,第二个线程-》按顺序执行

 

  线程组2:4个线程依次启动

2019-11-13 15:14:21,909 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2019-11-13 15:14:21,909 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2019-11-13 15:14:21,910 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*)
2019-11-13 15:14:21,915 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : 线程组1
2019-11-13 15:14:21,915 INFO o.a.j.e.StandardJMeterEngine: Starting 2 threads for group 线程组1.
2019-11-13 15:14:21,915 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2019-11-13 15:14:21,916 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=2 ramp-up=1 perThread=500.0 delayedStart=false
2019-11-13 15:14:21,918 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2019-11-13 15:14:21,918 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 2 : 线程组2
2019-11-13 15:14:21,918 INFO o.a.j.e.StandardJMeterEngine: Starting 4 threads for group 线程组2.
2019-11-13 15:14:21,918 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2019-11-13 15:14:21,918 INFO o.a.j.t.JMeterThread: Thread started: 线程组1 1-1
2019-11-13 15:14:21,918 INFO o.a.j.t.ThreadGroup: Starting thread group... number=2 threads=4 ramp-up=0 perThread=0.0 delayedStart=false
2019-11-13 15:14:21,919 INFO o.a.j.c.LoopController: iterationStart called on Loop Controller with source org.apache.jmeter.control.LoopController@1ccffced and iteration 1
2019-11-13 15:14:21,919 INFO o.a.j.s.FileServer: Stored: D:/zhangyang/jmeter/loginParameter.txt Alias: D:/zhangyang/jmeter/loginParameter.txt@2130155397
2019-11-13 15:14:21,919 INFO o.a.j.t.ThreadGroup: Started thread group number 2
2019-11-13 15:14:21,919 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2019-11-13 15:14:21,919 INFO o.a.j.t.JMeterThread: Thread started: 线程组2 2-2
2019-11-13 15:14:21,920 INFO o.a.j.s.FileServer: Stored: D:/zhangyang/jmeter/loginParameter.txt
2019-11-13 15:14:21,921 INFO o.a.j.t.JMeterThread: Thread started: 线程组2 2-3
2019-11-13 15:14:21,921 INFO o.a.j.t.JMeterThread: Thread started: 线程组2 2-4
2019-11-13 15:14:21,922 INFO o.a.j.t.JMeterThread: Thread started: 线程组2 2-1
2019-11-13 15:14:21,997 INFO o.a.j.t.JMeterThread: Thread is done: 线程组2 2-1
2019-11-13 15:14:21,997 INFO o.a.j.t.JMeterThread: Thread finished: 线程组2 2-1
2019-11-13 15:14:21,997 INFO o.a.j.t.JMeterThread: Thread is done: 线程组2 2-2
2019-11-13 15:14:21,997 INFO o.a.j.t.JMeterThread: Thread finished: 线程组2 2-2
2019-11-13 15:14:21,998 INFO o.a.j.t.JMeterThread: Thread is done: 线程组2 2-4
2019-11-13 15:14:21,998 INFO o.a.j.t.JMeterThread: Thread finished: 线程组2 2-4
2019-11-13 15:14:22,006 INFO o.a.j.t.JMeterThread: Thread is done: 线程组2 2-3
2019-11-13 15:14:22,006 INFO o.a.j.t.JMeterThread: Thread finished: 线程组2 2-3
2019-11-13 15:14:22,210 INFO o.a.j.t.JMeterThread: Thread is done: 线程组1 1-1
2019-11-13 15:14:22,210 INFO o.a.j.t.JMeterThread: Thread finished: 线程组1 1-1
2019-11-13 15:14:22,422 INFO o.a.j.t.JMeterThread: Thread started: 线程组1 1-2
2019-11-13 15:14:22,422 INFO o.a.j.c.LoopController: iterationStart called on Loop Controller with source org.apache.jmeter.control.LoopController@4ee41405 and iteration 1
2019-11-13 15:14:22,422 INFO o.a.j.s.FileServer: Stored: D:/zhangyang/jmeter/loginParameter.txt Alias: D:/zhangyang/jmeter/loginParameter.txt@554349279
2019-11-13 15:14:22,720 INFO o.a.j.t.JMeterThread: Thread is done: 线程组1 1-2
2019-11-13 15:14:22,720 INFO o.a.j.t.JMeterThread: Thread finished: 线程组1 1-2
2019-11-13 15:14:22,721 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2019-11-13 15:14:22,721 INFO o.a.j.s.FileServer: Close: D:/zhangyang/jmeter/loginParameter.txt@554349279
2019-11-13 15:14:22,722 INFO o.a.j.s.FileServer: Close: D:/zhangyang/jmeter/loginParameter.txt
2019-11-13 15:14:22,723 INFO o.a.j.s.FileServer: Close: D:/zhangyang/jmeter/loginParameter.txt@2130155397
2019-11-13 15:14:22,723 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)