Detailed jmeter different thread groups
Before doing performance testing, we look at a number of different applications JMeter thread group. First, JMeter provides three basic thread group, namely:
- Thread Group
- setUp Thread Group
- tearDown Thread Group
Other threads can be set via an integrated plug-in fashion, including:
- bzm - Arrivals Thread Group
- bzm - Concurrency Thread Group
- bzm - Free-Form Arrivals Thread Group
- jp@gc - Stepping Thread Group
- jp@gc - Ultimate Thread Group
Above, you can right-testing plan -> Add -> Threads (Users), select the corresponding thread group added.
1、Thread Group、setUp Thread Group和tearDown Thread Group
(1) Thread Group is the thread we usually use to simulate the number of users, each thread is equivalent to a virtual user;
(2) setUp Thread Group is a special thread group for performing an initialization operation before the test;
(3) tearDown Thread Group is a special thread group for performing the recovery work after the end of the test;
Above, setUp Thread Group and tearDown Thread Group, respectively, before and after the test execution; for example, before and after the stress test we perform, we can put the login operation in setUp Thread Group, after the test operation on the write-off tearDown Thread Group;
Described in detail as shown below:
Sampler execution after an error how to deal with:
continue: Continue
start next thread loop: begin the next cycle
stop thread: Stop the current thread
stop test: awaiting execution after the end of the current sampler, stop the entire test
stop test now: immediate cessation of all tests
Thread attributes:
number of threads: number of concurrent threads, the number of virtual users simulated operational
ramp-up period: the time to reach the specified thread required, i.e. the number of threads reaches the time set in the range
loop count: the number of cycles, if you do not set a specific value, it will keep doing this loop until manually stopped
Scheduler settings:
duration: the duration of the pressure test
startup delay: Start delay time, that is, after clicking to start testing before the official start time after the
2、Concurrency Thread Group、Stepping Thread Group
Concurrency Thread Group and Stepping Thread Group stepped pressure test can be used, but because of Stepping Thread Group has not been officially recommended, we conduct a brief introduction of Concurrency Thread Group.
target concurrency: concurrent goals
ramp up time (min): Acceleration Time
ramp-up steps count: count acceleration step
hold target rate time (min): retention time target rate
thread iterations limit: limit the number of iterations thread
log threads status into file: the thread state to a file
Above, graphically illustrates the process thread pressure.
E.g:
Thread groups 100, acceleration time of 5 minutes, step 10 to accelerate, maintain the target rate 10 minutes:
Acceleration step 10, step 10 threads per group;
5 min / 10 steps = 0.5, 0.5 minutes per step; i.e. ten loading per thread group 0.5 minute until reaching 100;
After reaching 100 thread groups, all of which will continue to run the thread group, the pressure for ten minutes.
3、Ultimate Thread Group
The thread group Concurrency Thread Group and similar, may be provided in conjunction with a plurality of thread groups, the results at each time are superimposed several thread groups.
start threads count: the number of concurrent goals
initial delay: Start delay time
startup time: the time required to start the target thread
hold load for:以目标线程并发持续加压时间
shutdown time:结束当前线程时间
4、Arrivals Thread Group
我们可以通过该线程组达到控制请求数的目的。
target rate:目标费率,每秒钟多少个请求数
ramp up time(sec):达到目标费率需要的时间
ramp-up steps count:达到目标费率需要多少步
hold target rate time(sec):保持目标费率时间
thread iterations limit:线程迭代次数限制
log threads status into file:将线程状态记录到文件
concurrency limit:最大并发数限制
例如:
目标费率为100,加速时间为10秒钟,5个加速步骤,保持目标费率10秒钟:
5个加速步骤,每步20增加个费率;
10s/5步=2,每步2秒钟;即每2秒钟加载20个费率,直到达到100;
达到100个费率之后,按照这个标准进行加压10秒钟;
以上,前十秒钟按照设置不断增加费率,请求数为(20+40+60+80+100)*2=600个;后十秒钟,按照每秒100个费率计算,请求数为100*10=1000个;共计1600个请求数。
5、Free-Form Arrivals Thread Group
该线程组与Arrivals Thread Group类似,不过是通过设置起始值、终止值和持续时间来达到压测目的。而且可以设置多个线程的集合。
文章属于转载
来源链接:https://blog.csdn.net/sinat_32434273/article/details/81119516