Apache JMeter
1.9

org.apache.jmeter.threads
Class ThreadGroup

java.lang.Object
  |
  +--org.apache.jmeter.testelement.AbstractTestElement
        |
        +--org.apache.jmeter.threads.ThreadGroup
All Implemented Interfaces:
Cloneable, Controller, SampleListener, Serializable, TestElement
Direct Known Subclasses:
ReflectionThreadGroup

public class ThreadGroup
extends AbstractTestElement
implements SampleListener, Serializable, Controller

ThreadGroup

Version:
$Id: ThreadGroup.java,v 1.14 2003/06/28 19:35:40 jeremy_a Exp $
Author:
Michael Stover
See Also:
Serialized Form

Field Summary
static String END_TIME
           
static String MAIN_CONTROLLER
           
static String NUM_THREADS
           
static String RAMP_TIME
           
static String SCHEDULER
           
static String START_TIME
           
 
Fields inherited from class org.apache.jmeter.testelement.AbstractTestElement
log
 
Fields inherited from interface org.apache.jmeter.testelement.TestElement
ENABLED, GUI_CLASS, NAME, TEST_CLASS
 
Constructor Summary
ThreadGroup()
          No-arg constructor.
 
Method Summary
 void addIterationListener(LoopIterationListener lis)
          Controllers have to notify listeners of when they begin an iteration through their sub-elements.
 void addTestElement(TestElement child)
          Add a test element.
 int getDefaultNumThreads()
          Get the default number of threads.
 int getDefaultRampUp()
          Get the default ramp-up value.
 long getEndTime()
          Get the end time value.
 int getNumThreads()
          Get the number of threads.
 int getRampUp()
          Get the ramp-up value.
 Controller getSamplerController()
          Get the sampler controller.
 boolean getScheduler()
          Get the Scheduler value.
 long getStartTime()
          Get the start time value.
 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.
 Sampler next()
          Delivers the next Sampler.
 void sampleOccurred(SampleEvent e)
          A sample has occurred.
 void sampleStarted(SampleEvent e)
          A sample has started.
 void sampleStopped(SampleEvent e)
          A sample has stopped.
 void setEndTime(long etime)
          Set the EndTime value.
 void setNumThreads(int numThreads)
          Set the nuber of threads.
 void setRampUp(int rampUp)
          Set the ramp-up value.
 void setSamplerController(LoopController c)
          Set the sampler controller.
 void setScheduler(boolean Scheduler)
          Set the Scheduler value.
 void setStartTime(long stime)
          Set the StartTime value.
 
Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement
addProperty, clear, clone, equals, getName, getProperty, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsLong, getPropertyAsString, isRunningVersion, logProperties, mergeIn, nextIsNull, propertyIterator, recoverRunningVersion, removeProperty, setName, setProperty, setProperty, setRunningVersion, traverse, traverseCollection, traverseMap, traverseProperty
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.jmeter.testelement.TestElement
clear, clone, getProperty, getPropertyAsBoolean, getPropertyAsFloat, getPropertyAsInt, getPropertyAsLong, getPropertyAsString, isRunningVersion, propertyIterator, recoverRunningVersion, removeProperty, setProperty, setProperty, setRunningVersion, traverse
 

Field Detail

NUM_THREADS

public static final String NUM_THREADS
See Also:
Constant Field Values

RAMP_TIME

public static final String RAMP_TIME
See Also:
Constant Field Values

MAIN_CONTROLLER

public static final String MAIN_CONTROLLER
See Also:
Constant Field Values

SCHEDULER

public static final String SCHEDULER
See Also:
Constant Field Values

START_TIME

public static final String START_TIME
See Also:
Constant Field Values

END_TIME

public static final String END_TIME
See Also:
Constant Field Values
Constructor Detail

ThreadGroup

public ThreadGroup()
No-arg constructor.

Method Detail

setNumThreads

public void setNumThreads(int numThreads)
Set the nuber of threads.

Parameters:
numThreads - the number of threads.

isDone

public boolean isDone()
Description copied from interface: Controller
Indicates whether the Controller is done delivering Samplers for the rest of the test.

Specified by:
isDone in interface Controller
Returns:
boolean

next

public Sampler next()
Description copied from interface: Controller
Delivers the next Sampler.

Specified by:
next in interface Controller
Returns:
org.apache.jmeter.samplers.Sampler

setScheduler

public void setScheduler(boolean Scheduler)
Set the Scheduler value.

Parameters:
Scheduler - the Scheduler value.

getScheduler

public boolean getScheduler()
Get the Scheduler value.

Returns:
the Scheduler value.

setStartTime

public void setStartTime(long stime)
Set the StartTime value.


getStartTime

public long getStartTime()
Get the start time value.

Returns:
the start time value.

setEndTime

public void setEndTime(long etime)
Set the EndTime value.


getEndTime

public long getEndTime()
Get the end time value.

Returns:
the end time value.

setRampUp

public void setRampUp(int rampUp)
Set the ramp-up value.

Parameters:
rampUp - the ramp-up value.

getRampUp

public int getRampUp()
Get the ramp-up value.

Returns:
the ramp-up value.

getSamplerController

public Controller getSamplerController()
Get the sampler controller.

Returns:
the sampler controller.

setSamplerController

public void setSamplerController(LoopController c)
Set the sampler controller.

Parameters:
c - the sampler controller.

getNumThreads

public int getNumThreads()
Get the number of threads.

Returns:
the number of threads.

getDefaultNumThreads

public int getDefaultNumThreads()
Get the default number of threads.

Returns:
the default number of threads.

getDefaultRampUp

public int getDefaultRampUp()
Get the default ramp-up value.

Returns:
the default ramp-up value (in seconds).

addTestElement

public void addTestElement(TestElement child)
Add a test element.

Specified by:
addTestElement in interface TestElement
Overrides:
addTestElement in class AbstractTestElement
Parameters:
child - the test element to add.

sampleOccurred

public void sampleOccurred(SampleEvent e)
A sample has occurred.

Specified by:
sampleOccurred in interface SampleListener
Parameters:
e - the sample event.

sampleStarted

public void sampleStarted(SampleEvent e)
A sample has started.

Specified by:
sampleStarted in interface SampleListener
Parameters:
e - the sample event.

sampleStopped

public void sampleStopped(SampleEvent e)
A sample has stopped.

Specified by:
sampleStopped in interface SampleListener
Parameters:
e - the sample event

addIterationListener

public void addIterationListener(LoopIterationListener lis)
Description copied from interface: Controller
Controllers have to notify listeners of when they begin an iteration through their sub-elements.

Specified by:
addIterationListener in interface Controller

initialize

public void initialize()
Description copied from interface: Controller
Called to initialize a controller at the beginning of a test iteration.

Specified by:
initialize in interface Controller

Apache JMeter
1.9

Copyright © 1998-2003 Apache Software Foundation. All Rights Reserved.