org.apache.jmeter.timers

Class ConstantThroughputTimer

Implemented Interfaces:
Cloneable, Serializable, TestBean, TestElement, TestListener, Timer

public class ConstantThroughputTimer
extends AbstractTestElement
implements Timer, TestListener, TestBean

This class implements a constant throughput timer. A Constant Throughtput Timer paces the samplers under its influence so that the total number of samples per unit of time approaches a given constant as much as possible. There are two different ways of pacing the requests: - delay each thread according to when it last ran - delay each thread according to when any thread last ran

Fields inherited from interface org.apache.jmeter.testelement.TestElement

COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS

Constructor Summary

ConstantThroughputTimer()
Constructor for a non-configured ConstantThroughputTimer.

Method Summary

protected long
calculateCurrentTarget(long currentTime)
long
delay()
Retrieve the delay to use during test execution.
String
getCalcMode()
double
getThroughput()
Gets the configured desired throughput.
void
setCalcMode(String mode)
void
setThroughput(double throughput)
Sets the desired throughput.
void
testEnded()
void
testEnded(String host)
void
testIterationStart(LoopIterationEvent event)
void
testStarted()
Get the timer ready to compute delays for a new test.
void
testStarted(String host)
String
toString()
Provide a description of this timer class.

Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement

addProperty, addTestElement, canRemove, clear, clearTemporary, clone, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, logProperties, mergeIn, propertyIterator, recoverRunningVersion, removeProperty, setComment, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse, traverseCollection, traverseMap, traverseProperty

Constructor Details

ConstantThroughputTimer

public ConstantThroughputTimer()
Constructor for a non-configured ConstantThroughputTimer.

Method Details

calculateCurrentTarget

protected long calculateCurrentTarget(long currentTime)
Parameters:
currentTime -
Returns:
new Target time

delay

public long delay()
Retrieve the delay to use during test execution.
Specified by:
delay in interface Timer
See Also:
Timer.delay()

getCalcMode

public String getCalcMode()

getThroughput

public double getThroughput()
Gets the configured desired throughput.
Returns:
the rate at which samples should occur, in samples per minute.

setCalcMode

public void setCalcMode(String mode)

setThroughput

public void setThroughput(double throughput)
Sets the desired throughput.
Parameters:
throughput - Desired sampling rate, in samples per minute.

testEnded

public void testEnded()
Specified by:
testEnded in interface TestListener

testEnded

public void testEnded(String host)
Specified by:
testEnded in interface TestListener

testIterationStart

public void testIterationStart(LoopIterationEvent event)
Specified by:
testIterationStart in interface TestListener

testStarted

public void testStarted()
Get the timer ready to compute delays for a new test.
Specified by:
testStarted in interface TestListener

testStarted

public void testStarted(String host)
Specified by:
testStarted in interface TestListener

toString

public String toString()
Provide a description of this timer class. TODO: Is this ever used? I can't remember where. Remove if it isn't -- TODO: or obtain text from bean's displayName or shortDescription.
Returns:
the description of this timer class.

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