public class ThreadGroup extends AbstractThreadGroup
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DELAY
Scheduler start delay, overrides start time
|
static java.lang.String |
DELAYED_START
Whether thread startup is delayed until required
|
static java.lang.String |
DURATION
Scheduler duration, overrides end time
|
static java.lang.String |
RAMP_TIME
Ramp-up time
|
static java.lang.String |
SCHEDULER
Whether scheduler is being used
|
MAIN_CONTROLLER, NUM_THREADS, ON_SAMPLE_ERROR, ON_SAMPLE_ERROR_CONTINUE, ON_SAMPLE_ERROR_START_NEXT_LOOP, ON_SAMPLE_ERROR_STOPTEST, ON_SAMPLE_ERROR_STOPTEST_NOW, ON_SAMPLE_ERROR_STOPTHREAD
COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS
Constructor and Description |
---|
ThreadGroup()
No-arg constructor.
|
Modifier and Type | Method and Description |
---|---|
JMeterThread |
addNewThread(int delay,
StandardJMeterEngine engine)
Add a new
JMeterThread to this ThreadGroup for engine |
long |
getDelay()
Get the startup delay
|
long |
getDuration()
Get the desired duration of the thread group test run
|
int |
getRampUp()
Get the ramp-up value.
|
boolean |
getScheduler()
Get whether scheduler is being used
|
int |
numberOfActiveThreads() |
void |
setDelay(long delay)
Set the startup delay
|
void |
setDuration(long duration)
Set the desired duration of the thread group test run
|
void |
setRampUp(int rampUp)
Set the ramp-up value.
|
void |
setScheduler(boolean scheduler)
Set whether scheduler is being used
|
void |
start(int groupNum,
ListenerNotifier notifier,
ListedHashTree threadGroupTree,
StandardJMeterEngine engine)
Start the
ThreadGroup |
void |
stop()
This is a clean shutdown.
|
boolean |
stopThread(java.lang.String threadName,
boolean now)
Stop thread called threadName:
stop JMeter thread
interrupt JMeter thread
interrupt underlying thread
|
void |
tellThreadsToStop()
This is an immediate stop interrupting:
current running threads
current running samplers
For each thread, invoke:
JMeterThread.stop() - set stop flag
JMeterThread.interrupt() - interrupt sampler
Thread.interrupt() - interrupt JVM thread
|
void |
tellThreadsToStop(boolean now) |
void |
threadFinished(JMeterThread thread)
Called by JMeterThread when it finishes
|
boolean |
verifyThreadsStopped() |
void |
waitThreadsStopped()
Wait for all Group Threads to stop
|
addIterationListener, addTestElement, addTestElementOnce, breakThreadLoop, getNumberOfThreads, getNumThreads, getOnErrorStartNextLoop, getOnErrorStopTest, getOnErrorStopTestNow, getOnErrorStopThread, getSamplerController, initialize, isDone, next, removeIterationListener, setNumThreads, setSamplerController, startNextLoop, triggerEndOfLoop
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
public static final java.lang.String RAMP_TIME
public static final java.lang.String DELAYED_START
public static final java.lang.String SCHEDULER
public static final java.lang.String DURATION
public static final java.lang.String DELAY
public void setScheduler(boolean scheduler)
scheduler
- true is scheduler is to be usedpublic boolean getScheduler()
public long getDuration()
public void setDuration(long duration)
duration
- in secondspublic long getDelay()
public void setDelay(long delay)
delay
- in secondspublic void setRampUp(int rampUp)
rampUp
- the ramp-up value.public int getRampUp()
public void start(int groupNum, ListenerNotifier notifier, ListedHashTree threadGroupTree, StandardJMeterEngine engine)
AbstractThreadGroup
ThreadGroup
start
in class AbstractThreadGroup
groupNum
- group numbernotifier
- ListenerNotifier
threadGroupTree
- ListedHashTree
engine
- StandardJMeterEngine
public JMeterThread addNewThread(int delay, StandardJMeterEngine engine)
AbstractThreadGroup
JMeterThread
to this ThreadGroup
for engineaddNewThread
in class AbstractThreadGroup
delay
- Delay in millisecondsengine
- StandardJMeterEngine
JMeterThread
public boolean stopThread(java.lang.String threadName, boolean now)
stopThread
in class AbstractThreadGroup
threadName
- String thread namenow
- boolean for stoppublic void threadFinished(JMeterThread thread)
public void tellThreadsToStop(boolean now)
public void tellThreadsToStop()
JMeterThread.stop()
- set stop flagJMeterThread.interrupt()
- interrupt samplerThread.interrupt()
- interrupt JVM threadtellThreadsToStop
in class AbstractThreadGroup
public void stop()
JMeterThread.stop()
- set stop flagstop
in class AbstractThreadGroup
public int numberOfActiveThreads()
numberOfActiveThreads
in class AbstractThreadGroup
public boolean verifyThreadsStopped()
verifyThreadsStopped
in class AbstractThreadGroup
public void waitThreadsStopped()
waitThreadsStopped
in class AbstractThreadGroup
Copyright © 1998-2019 Apache Software Foundation. All Rights Reserved.