|
Apache JMeter 2.0.1.20050615 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jmeter.protocol.java.sampler.AbstractJavaSamplerClient
org.apache.jmeter.protocol.java.test.SleepTest
The SleepTest class is a simple example class for a
JMeter Java protocol client. The class implements the
JavaSamplerClient interface.
During each sample, this client will sleep for some amount of time. The amount of time to sleep is determined from the two parameters SleepTime and SleepMask using the formula:
totalSleepTime = SleepTime + (System.currentTimeMillis() % SleepMask)
Thus, the SleepMask provides a way to add a random component
to the sleep time.
| Field Summary | |
static long |
DEFAULT_SLEEP_MASK
The default value of the SleepMask parameter. |
static long |
DEFAULT_SLEEP_TIME
The default value of the SleepTime parameter, in milliseconds. |
| Constructor Summary | |
SleepTest()
Default constructor for SleepTest.
|
|
| Method Summary | |
Arguments |
getDefaultParameters()
Provide a list of parameters which this test supports. |
SampleResult |
runTest(JavaSamplerContext context)
Perform a single sample. |
void |
setupTest(JavaSamplerContext context)
Do any initialization required by this client. |
void |
teardownTest(JavaSamplerContext context)
Do any clean-up required by this test. |
| Methods inherited from class org.apache.jmeter.protocol.java.sampler.AbstractJavaSamplerClient |
getLogger |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final long DEFAULT_SLEEP_TIME
public static final long DEFAULT_SLEEP_MASK
| Constructor Detail |
public SleepTest()
SleepTest.
The Java Sampler uses the default constructor to instantiate
an instance of the client class.
| Method Detail |
public void setupTest(JavaSamplerContext context)
setupTest in interface JavaSamplerClientsetupTest in class AbstractJavaSamplerClientcontext - the context to run with. This provides access
to initialization parameters.public SampleResult runTest(JavaSamplerContext context)
SampleResult object.
SampleResult has many fields which can be
used. At a minimum, the test should use
SampleResult.sampleStart and
SampleResult.sampleEndto set the time that
the test required to execute. It is also a good idea to
set the sampleLabel and the successful flag.
runTest in interface JavaSamplerClientcontext - the context to run with. This provides access
to initialization parameters.
SampleResult.sampleStart(),
SampleResult.sampleEnd(),
SampleResult.setSuccessful(boolean),
SampleResult.setSampleLabel(String)public void teardownTest(JavaSamplerContext context)
teardownTest in interface JavaSamplerClientteardownTest in class AbstractJavaSamplerClientcontext - the context to run with. This provides access
to initialization parameters.public Arguments getDefaultParameters()
getDefaultParameters in interface JavaSamplerClientgetDefaultParameters in class AbstractJavaSamplerClient
|
Apache JMeter 2.0.1.20050615 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||