Thread group

                 A Thread Group in JMeter represents a pool of virtual users performing a set of operations. For example, considering Google search scenario, one set of users will be using the search by text functionality, others will be using News Search, some other smaller section of users might be using search by image functionality. While creating a performance test script, for all these users, we will create different Thread Groups in JMeter with different thread count. The different types of Samplers like HTTP requests are added as child of these Thread Group elements to simulate the requests made by users to the server.
To launch the Thread Group in JMeter by following the path-
step 1: Right Click on Test Plan
step 2: choose Threads(Users)
step 3:Click Thread Group
After performing those steps we can see the following interface

Thread Group Properties
The Thread Group element has a control panel(right pane) that can be use to configure the various parameters in a performance test like - number of virtual users to generate, scheduling of the test, introducing of delays in the test etc.
Name - This is the name of the Thread Group, signifying the action performed by the virtual users e.g. if a Thread Group is scripted to perform login operation then we can have Thread Group name as 'LoginUsers'.
Comments - This is basically an optional textbox, that should contain the description of the action performed by the Thread Group or any other metadata information.
Configurations inside the "Action to be taken after a Sampler Error" block are used to configure the test for actions performed in case of any sampler error, because of no response from server or any assertion error-
  1. Continue - In case of sampler error the test should continue.
  2. Start Next Thread Loop - The test continues with next thread execution.
  3. Stop Thread - The current thread gets stopped in case of error.
  4. Stop Test - The thread is stopped gracefully, completing the current sampler request.
  5. Stop Test Now - Abrupt stopping of thread in case of any error.
Configurations inside the "Thread Properties" block-
  1. Number of Threads(users) - The number of virtual users to be simulated.
  2. Ramp-up Period(in seconds) - The total amount of time taken to get all the thread started. For example - if we want each thread to be active in 0.5 seconds and there are total of 50 threads, then Ramp Up time should be 50*0.5 i.e. 25 seconds. We will see the benefit of using Ramp-Up period in our coming posts.
  3. Loop Count- This is the count of the number of loop iteration performing a set of operations defined inside a thread group.
  4. Loop Count Forever- When checked, it disables or overrides the loop count value and causes the loop to run infinitely until manually stopped.
  5. Delay Thread Creation until needed - This is used to delay the thread creation till a value specified in this field(in seconds).
  6. Scheduler - When checked, the scheduler configurations are enabled(explained below) and considered for scheduling of test at a particular time. Otherwise, the test run as soon as we run the test.
Configurations inside the "Scheduler Configuration" block-
  1. Duration(seconds) - Duration specifies the duration of the test, once reached the test stops.
  2. Startup delay(seconds) - On running a Test Script, JMeter will wait for the startup delay specified.
  3. Start Time - This field is used to specify an absolute value of system time for starting the test, once the test is run. It is considered only if the above 'Duration' field is empty.
  4. End Time - This field is used to specify an absolute value of system time for ending the test. It is considered only if the above 'Duration' field is empty.
Note:
To run the jmeter in non-gui mode we have to do parametrization for ramp-up , ramp-down , duration .
For example :
number of threads---------------------${__P(Threads,50)}
ramp-up --------------------------------${__P(RampUp,5)}
duration---------------------------------${__P(Duration,120)}


(while writing command to execute jmeter script in non- gui mode we have to use like J Threads=100  , J RampUp=60 , J Duration =120 )

No comments:

Post a Comment