Class AbstractThreadGroup

  • All Implemented Interfaces:
    java.io.Serializable , java.lang.Cloneable , org.apache.jmeter.control.Controller , org.apache.jmeter.gui.Searchable , org.apache.jmeter.testelement.TestElement , org.apache.jmeter.threads.JMeterThreadMonitor , org.apache.jmeter.threads.TestCompilerHelper

    
    public abstract class AbstractThreadGroup
    extends AbstractTestElement implements Serializable, Controller, JMeterThreadMonitor, TestCompilerHelper
                        

    ThreadGroup holds the settings for a JMeter thread group. This class is intended to be ThreadSafe.

    • Constructor Detail

      • AbstractThreadGroup

        AbstractThreadGroup()
    • Method Detail

      • isDone

         boolean isDone()

        Indicates whether the Controller is done delivering Samplers for the rest of the test. When the top-level controller returns true to JMeterThread, the thread is complete.

      • next

         Sampler next()

        Delivers the next Sampler or null

      • addTestElementOnce

         final boolean addTestElementOnce(TestElement child)

        Add child test element only if it has not already been added.

        Only for use by TestCompiler.

      • initialize

         void initialize()

        Called to initialize a controller at the beginning of a test iteration.

      • startNextLoop

         void startNextLoop()

        Start next iteration after an error

      • setNumThreads

         void setNumThreads(int numThreads)

        Set the total number of threads to start

        Parameters:
        numThreads - the number of threads.
      • getNumberOfThreads

         int getNumberOfThreads()

        Get the number of active threads

        Returns:

        the number of active threads

      • getNumThreads

         int getNumThreads()

        Get the number of threads.

        Returns:

        the number of threads.

      • getOnErrorStartNextLoop

         boolean getOnErrorStartNextLoop()

        Check if a sampler error should cause thread to start next loop.

        Returns:

        true if thread should start next loop

      • getOnErrorStopThread

         boolean getOnErrorStopThread()

        Check if a sampler error should cause thread to stop.

        Returns:

        true if thread should stop

      • getOnErrorStopTest

         boolean getOnErrorStopTest()

        Check if a sampler error should cause test to stop.

        Returns:

        true if test (all threads) should stop

      • getOnErrorStopTestNow

         boolean getOnErrorStopTestNow()

        Check if a sampler error should cause test to stop now.

        Returns:

        true if test (all threads) should stop immediately

      • stopThread

         abstract boolean stopThread(String threadName, boolean now)

        Hard or graceful stop depending on now flag

        Parameters:
        threadName - String thread name
        now - if true interrupt Thread
        Returns:

        boolean true if stop succeeded

      • verifyThreadsStopped

         abstract boolean verifyThreadsStopped()
        Returns:

        true if threads were correctly stopped

      • waitThreadsStopped

         abstract void waitThreadsStopped()

        Wait for all Group Threads to stop after a graceful stop

      • tellThreadsToStop

         abstract void tellThreadsToStop()

        This immediately stop threads of Group by interrupting them. It differs from stop by being a hard stop

      • stop

         abstract void stop()

        This gracefully stops threads of Group

      • setIsSameUserOnNextIteration

         void setIsSameUserOnNextIteration(boolean isSameUserOnNextIteration)

        Set the kind of user

        Parameters:
        isSameUserOnNextIteration - true is the same user on next iteration of loop false is a different user on next iteration of loop
      • isSameUserOnNextIteration

         boolean isSameUserOnNextIteration()

        Get kind of user:

        • true means same user running multiple iterations
        • false means a different user for each iteration
        Returns:

        the kind of user.

      • cloneTree

        @API(status = API.Status.EXPERIMENTAL, since = "5.5") static ListedHashTree cloneTree(ListedHashTree tree)
        Parameters:
        tree - ListedHashTree
        Returns:

        a clone of tree