What is the meaning of "Thread Group" in JMeter?

I do not understand what a "thread group" means in JMeter. Does this mean that all tests (Java requests, etc.) relate to a specific group of threads running in a single thread, or each test in this threading group is running in a separate thread? I could not get a clear idea of ​​this from the JMeter or googling documentation.

+7
source share
4 answers

For an explanation see:

A thread group is a collection of threads that execute the same script. Set the number of iterations in the configuration. The behavior of the stream is determined in accordance with the growth and destruction, as soon as the number of iterations per stream has passed.

Please note that from version 2.8 you can postpone the creation of a thread until the thread starts working, this will be adapted for tests that use very short threads and many threads.

Thread groups can be thought of as a set of virtual users, but not necessarily. It may be something else depending on how you design your test.

+6
source

As I understand it (what I wanted to know), all operations in the JMeter thread group are performed sequentially once for each thread and iteration. Thus, this means that each of the operations in the thread group is not performed in its own separate set of threads, but it shared each thread with other operations in its thread group.

For example,

  • Group Theme 1
    • Operation 1
    • Operation 2
    • Operation 3

If we planned this thread group Thread Group 1 to run in 3 threads, the following will happen:

  • Operation 1, operation 2 and operation 3 are performed in thread 1.
  • Operation 1, operation 2 and operation 3 are performed in thread 2.
  • Operation 1, Operation 2 and Operation 3 are performed in thread 3. etc

Previously, I was not sure that each of these operations is performed in a separate thread.

+4
source

Subject = simulated user.
So, thread group = users.
Check out jMeter Plugins thread group controllers with much more control than the default thread group.

+1
source

Just to further participate in my own research (for clarity and completeness, I hope):

  • ThreadGroup has queries / "operations" as described above (in the summary of Manjula Weerasinge), but also has user and loop configurations.
  • ThreadGroup creates a thread for each user. This thread (representing the user) performs all the operations in this ThreadGroup, sequentially in this loop.
  • These threads are reused in all loops - this is: loop 2 will also perform the same set of operations as n different users, but it will reuse the same threads as loop 1.

Thus, ThreadGroup has a thread for each user and is used to run all the tests in this group for all loops.

This was true for two cycles with 10 users, where my test contained the following:

 System.out.println("MyTest#testSearchNodeByNodeNameExactMatch: MyTest=" +this + "(" +System.identityHashCode(this) +")" +", thread=" +System.identityHashCode(Thread.currentThread())); 

And the logs can be summarized using (assuming println output written to thread-output.2.txt):

 grep MyTest#test thread-output.2.txt | awk -F ', ' '{print $2}' | sort | uniq 
0
source

All Articles