public abstract class AbstractThreadGroup extends AbstractTestElement implements Serializable, Controller, JMeterThreadMonitor, TestCompilerHelper
Modifier and Type | Field and Description |
---|---|
static String |
IS_SAME_USER_ON_NEXT_ITERATION
The same user or different users
|
static String |
MAIN_CONTROLLER |
static String |
NUM_THREADS
Number of threads in the thread group
|
static String |
ON_SAMPLE_ERROR
Action to be taken when a Sampler error occurs
|
static String |
ON_SAMPLE_ERROR_CONTINUE
Continue, i.e.
|
static String |
ON_SAMPLE_ERROR_START_NEXT_LOOP
Start next loop for current thread if sampler error occurs
|
static String |
ON_SAMPLE_ERROR_STOPTEST
Stop test (all threads) if sampler error occurs, the entire test is stopped at the end of any current samples
|
static String |
ON_SAMPLE_ERROR_STOPTEST_NOW
Stop test NOW (all threads) if sampler error occurs, the entire test is stopped abruptly.
|
static String |
ON_SAMPLE_ERROR_STOPTHREAD
Stop current thread if sampler error occurs
|
COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS
Constructor and Description |
---|
AbstractThreadGroup() |
Modifier and Type | Method and Description |
---|---|
void |
addIterationListener(LoopIterationListener lis)
Controllers have to notify listeners of when they begin an iteration
through their sub-elements.
|
abstract JMeterThread |
addNewThread(int delay,
StandardJMeterEngine engine)
Add a new
JMeterThread to this ThreadGroup for engine |
void |
addTestElement(TestElement child)
Add a test element.
|
boolean |
addTestElementOnce(TestElement child)
Add child test element only if it has not already been added.
|
void |
breakThreadLoop() |
int |
getNumberOfThreads()
Get the number of active threads
|
int |
getNumThreads()
Get the number of threads.
|
boolean |
getOnErrorStartNextLoop()
Check if a sampler error should cause thread to start next loop.
|
boolean |
getOnErrorStopTest()
Check if a sampler error should cause test to stop.
|
boolean |
getOnErrorStopTestNow()
Check if a sampler error should cause test to stop now.
|
boolean |
getOnErrorStopThread()
Check if a sampler error should cause thread to stop.
|
Controller |
getSamplerController()
Get the sampler controller.
|
void |
initialize()
Called to initialize a controller at the beginning of a test iteration.
|
boolean |
isDone()
Indicates whether the Controller is done delivering Samplers for the rest
of the test.
|
boolean |
isSameUserOnNextIteration()
Get kind of user:
true means same user running multiple iterations
false means a different user for each iteration
|
Sampler |
next()
Delivers the next Sampler or null
|
abstract int |
numberOfActiveThreads() |
void |
removeIterationListener(LoopIterationListener iterationListener)
Unregister IterationListener
|
void |
setIsSameUserOnNextIteration(boolean isSameUserOnNextIteration)
Set the kind of user
|
void |
setNumThreads(int numThreads)
Set the total number of threads to start
|
void |
setSamplerController(LoopController c)
Set the sampler controller.
|
abstract void |
start(int groupCount,
ListenerNotifier notifier,
ListedHashTree threadGroupTree,
StandardJMeterEngine engine)
Start the
ThreadGroup |
void |
startNextLoop()
Start next iteration after an error
|
abstract void |
stop()
This gracefully stops threads of Group
|
abstract boolean |
stopThread(String threadName,
boolean now)
Hard or graceful stop depending on now flag
|
abstract void |
tellThreadsToStop()
This immediately stop threads of Group by interrupting them.
|
void |
triggerEndOfLoop()
NOOP
|
abstract boolean |
verifyThreadsStopped() |
abstract void |
waitThreadsStopped()
Wait for all Group Threads to stop after a graceful stop
|
addPropertiesValues, addProperty, addProperty, canRemove, clear, clearTemporary, clearTestElementChildren, clone, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getSearchableTokens, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, logProperties, mergeIn, propertyIterator, recoverRunningVersion, removeProperty, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse, traverseCollection, traverseMap, traverseProperty
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
canRemove, clear, clearTestElementChildren, clone, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getThreadContext, getThreadName, isEnabled, isRunningVersion, isTemporary, propertyIterator, recoverRunningVersion, removed, removeProperty, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse
threadFinished
public static final String ON_SAMPLE_ERROR
public static final String ON_SAMPLE_ERROR_CONTINUE
public static final String ON_SAMPLE_ERROR_START_NEXT_LOOP
public static final String ON_SAMPLE_ERROR_STOPTHREAD
public static final String ON_SAMPLE_ERROR_STOPTEST
public static final String ON_SAMPLE_ERROR_STOPTEST_NOW
public static final String NUM_THREADS
public static final String MAIN_CONTROLLER
public static final String IS_SAME_USER_ON_NEXT_ITERATION
public boolean isDone()
isDone
in interface Controller
public Sampler next()
next
in interface Controller
public Controller getSamplerController()
public void setSamplerController(LoopController c)
c
- the sampler controller.public void addTestElement(TestElement child)
addTestElement
in interface TestElement
addTestElement
in class AbstractTestElement
child
- the test element to add.public final boolean addTestElementOnce(TestElement child)
Only for use by TestCompiler.
addTestElementOnce
in interface TestCompilerHelper
child
- the TestElement
to be addedtrue
if the child was addedpublic void addIterationListener(LoopIterationListener lis)
addIterationListener
in interface Controller
lis
- The LoopIterationListener
to addpublic void removeIterationListener(LoopIterationListener iterationListener)
removeIterationListener
in interface Controller
iterationListener
- LoopIterationListener
public void initialize()
initialize
in interface Controller
public void startNextLoop()
public void triggerEndOfLoop()
triggerEndOfLoop
in interface Controller
public void setNumThreads(int numThreads)
numThreads
- the number of threads.public int getNumberOfThreads()
public int getNumThreads()
public boolean getOnErrorStartNextLoop()
public boolean getOnErrorStopThread()
public boolean getOnErrorStopTest()
public boolean getOnErrorStopTestNow()
public abstract boolean stopThread(String threadName, boolean now)
threadName
- String thread namenow
- if true interrupt Thread
public abstract int numberOfActiveThreads()
public abstract void start(int groupCount, ListenerNotifier notifier, ListedHashTree threadGroupTree, StandardJMeterEngine engine)
ThreadGroup
groupCount
- group numbernotifier
- ListenerNotifier
threadGroupTree
- ListedHashTree
engine
- StandardJMeterEngine
public abstract JMeterThread addNewThread(int delay, StandardJMeterEngine engine)
JMeterThread
to this ThreadGroup
for enginedelay
- Delay in millisecondsengine
- StandardJMeterEngine
JMeterThread
public abstract boolean verifyThreadsStopped()
public abstract void waitThreadsStopped()
public abstract void tellThreadsToStop()
stop()
by being a hard stoppublic abstract void stop()
public void breakThreadLoop()
public void setIsSameUserOnNextIteration(boolean isSameUserOnNextIteration)
isSameUserOnNextIteration
- true is the same user on next iteration of loop
false is a different user on next iteration of looppublic boolean isSameUserOnNextIteration()
Copyright © 1998-2019 Apache Software Foundation. All Rights Reserved.