JMeter Test Plan的组成部分之Thread Group

来源:互联网 发布:最终幻想雷霆身材数据 编辑:程序博客网 时间:2024/05/21 19:23

 JMeter Test Plan的组成部分之Thread Group

A Thread Group is the starting point of a Test Plan, and it should contain all other
JMeter elements. A thread group controls the threads that will be created by JMeter
to simulate simultaneous users。


A Thread Group representsa group of users that will execute a particular test case.
In its Control Panel, shown in the following figure, you will be able to simulate the
"number of users", how long it takes to start each "user" (or how often the users
should send requests
), the number of times to perform the test (or how many
requests they should send
), and a start and stop time for each test.




Elements must beplaced under a Thread Group as they define a Test Plan. A Thread Group controls the number of threads (or "users")JMeter will use to execute your
test. If there are two or more Thread Groups in the same Test Plan, each Thread
Group will execute completely independently from each other
. Multiple Thread
Groups within the same Test Plan simply simulate groups of concurrent, individual
connections to your server application
. The Control Panel allows us to configure each
Thread Group to have its own set of specific "behaviors".


Each feature of this component is described as follows:

Action to be taken after a Sampler error:In case of any error recorded in any

Sample as the test runs, you may let the test either:Continue to the next element in
the test, or Stop Thread to stop the current Thread, or Stop Test completely, in case
you want to inspect the error before continue running.

Number of Threads: Simulates the number of user(s) or connection(s) to your

server application.

Ramp-Up Period: Defines how long it will take JMeter to get all threads running.

For example, if there are 10 threads and a ramp-up period of 60 seconds, then each
successive thread will be delayed by 6 seconds. In 60 seconds, all threads would be
up and running
. The best policy is to make your ramp-up period long enough to
avoid large workload as the test begins, but short enough to allow the last one to
start running before finishing the first one. You may set your ramp-up period to be
equal with the number of threads, and later adjust accordingly
.


Loop Count: Defines the number of times to execute the test. By default, the test is

executed once but you can adjust as needed. Clicking theForever checkbox causes
the test to run repeatedly until stopped manually.

Scheduler checkbox: Once selected, the Scheduler Configuration section will appear

at the bottom of the control panel.


Scheduler Configuration: Version 1.9 and later reveals this feature, where you can

set the start and end time of running the test. Once you start the test, it will not
execute any elements until the start time is reached. After each execution cycle,
unless the end-time is reached, in which case the run is stopped, the iteration will
continue until the loop count limit. The startup delay field allows JMeter some time
before a thread is started and the duration field lets you define the duration of the
whole test. The former overrides start-time, while the latter overridesend-time.

读书笔记:Apache JMeter

0 0
原创粉丝点击