Monday, October 27, 2014

Threads in JMeter

Threads in JMeter are basically the number of virtual users. Virtual users are used to mimic the actions done by real users on the application. It can range from navigation to page, sending data via text boxes to transactions etc. It provides many options to control the threads by providing different settings. Let us see what are the options present in here. Below is the UI for a newly added thread group.


All controllers and samplers must be under a thread group in order to execute different logic as provided. Each of the thread groups runs in isolation as each one is independent of other.
Thread properties present includes:
  • Number of Threads (users)
  • Ramp-up period (in seconds)
  • Loop Count



Number of Threads (users) is the number of virtual users that would be accessing the application.

Ramp-up period is the duration in which you want the virtual users to be in your system/application.
If 5 threads are used, and the ramp-up period is 50 seconds, then JMeter will take 50 seconds to get all 5 threads up and running. Each thread will start 10 (50/5) seconds after the previous thread was begun.

Loop Count is the used to setting the number of times to execute the test. By default, the thread group is configured to loop once through its elements.

It also have a provision of decision making in case of any sampler error. One can select the various options upon failure.
  1. Continue
  2. Start next thread loop
  3. Stop thread
  4. Stop test
  5. Stop test now


Scheduler options can be viewed by clicking the check box at the bottom of the thread group panel. Here you can enter the start and end times of the run. When the test is started, JMeter will wait if necessary until the start-time has been reached. At the end of each cycle, JMeter checks if the end-time has been reached, and if so, the run is stopped, otherwise the test is allowed to continue until the iteration limit is reached.


Above are basic thread group settings that JMeter provides and can be used as per need.

No comments:

Post a Comment