Updated March 30, 2023
Definition of JMeter thread group
JMeter is an open-source tool to perform preference and load testing; in JMeter, we have the functionality to maintain all test scenarios under the same category that we called Thread Group. In another word, we can say that it is used to execute the group of threads under the same group. Normally the Thread Group is a very base element of every Test Plan. We can add the multiple thread groups in JMeter, and that can simulate how we can interact with the application. Under the Thread group, we created multiple samplers and listeners per the user requirement.
How to Use the SetUp JMeter Thread group?
Now let’s see how we can set up the Thread Group in JMeter.
Thread Group components are the starting places of any test plan. All the samplers and controllers in JMeter should be under a specified Thread Group. Different components, for example, Audience members, might be put straightforwardly under the test plan, in which case they will apply to all the thread groups. As the name infers, the string bunch component controls the quantity of strings JMeter will use to execute your test. The controls for a thread group permit us to follow points as follows.
- We can set the number of thread groups as per our requirement.
- Set the increased time frame.
- Set the times to execute the test.
Before creating, we must ensure that JMeter is working fine. If JMeter is working fine, we need to follow the following steps.
1. First, start the JMeter.
2. After starting JMeter, we need to select the Test Plan.
3. Here, we got the Thread Group option; click on it.
4. Inside the Thread Group, we have different components such as Name, Comments, and action. So as per our requirement, we make the changes on this tab.
5. After completion of the component, we can also set the thread properties as per the requirement.
JMeter thread group Arrival
Let’s see how we can use arrivals in thread groups as follows.
The Arrivals Thread Group is really great for more conventional burden testing. A potential situation could be something like ‘Is our framework performing admirably when clients are purchasing 20 tickets each moment for a term of 60 minutes?’.
The Free-Form Arrivals Thread Group is really great for load testing, yet it is additionally extraordinary for Stress testing situations like Spike testing. A potential situation could be a like thing “Would our framework be able to deal with 40,000 ticket deals shortly after the beginning of advancement? If we need to do separation of load testing and stress testing over the connection.
The string bunch works with the “appearances” plan as a method for communicating the heap. “Appearance” signifies strong emphasis. It will make new strings on the off chance that all current strings are occupied in emphasis.
Note that a consistent appearance rate implies expanding simultaneousness, so be cautious with the qualities you enter. Use the “Simultaneousness Limit” field as a well-being valve to forestall running out of memory.
Now let’s see how we can add arrival thread apache plugins into the JMeter as follows.
First, we need to download the jar file. After successful completion of the download, extract that folder and follow the following steps as follows.
1. After extracting the folder, copy the jar and paste it inside the bin folder of JMeter.
2. Now copy plugins casutg jar file and paste inside the bin folder of JMeter.
Now let’s see how we can add the Arrival Thread Group into the Test Plan.
1. First right, click on the Test Plan, select Add option, and select the Thread option.
2. Inside the Thread option, we arrive at the Thread Group option, as shown in the following screenshot.
Now we need to configure the workload by using Arrival Thread with the following parameter as follows.
Target Rate: Here, we need to set the target rate in minutes as per our requirement.
Ramp Up Time: It is also in minutes.
Ramp-Up Step Count
Time Unit
Thread Limit
Status of Log Thread
Limit of Concurrency.
We also need to set the input fields as follows.
- Name: Here, we need to provide the name of the Thread Group.
- Comments: This is an optional part per our requirement; we can add comments.
- Action: Inside the action, we have different fields that we can file per our requirements.
Other parameters we already discussed in the same points.
Example
Now let’s see a screenshot of the Arrivals Thread group that contains the following examples.
In the above screenshot, we set all the parameters, and the below screenshot shows the graph as follows.
Create a JMeter thread group
Now let’s see how we can create a Thread Group in JMeter.
In the above, we discussed one of the types of Thread Group. Now let’s see examples of how we can create as follows.
First, we need to create the Test Plan, as shown in the following screenshot.
Now right-click on the Test Plan and select add option as shown in the following screenshot.
Here we can set the name of the thread group and comments as per requirement.
And we also have the SetUp Thread Group option, as shown in the following screenshot.
Now add the HTTP request sampler as shown in the following screenshot.
Now we need to add the listener to view the result, as shown in the following screenshot.
Now save the Test Plan and run the Test Plan, and we can see the output in the following screenshot as follows.
Concurrency
Now setting concurrency Thread Group in JMeter, here we have already created a Test Plan same like Arrival Thread Group. The following screenshot shows the setup of the concurrency of Thread Group as follows.
Conclusion
We hope from this article, you learn more about the JMeter thread group. From the above article, we have taken in the essential idea of the JMeter thread group t, and we also see the representation and example of the JMeter thread group. From this article, we learned how and when we use the JMeter thread group.
Recommended Articles
This is a guide to the JMeter thread group. Here we discuss the definition, How to Use the SetUp JMeter thread group, and Examples with code implementation. You may also have a look at the following articles to learn more –