Class ConstantThroughputTimer
- All Implemented Interfaces:
Serializable
,Cloneable
,Searchable
,TestBean
,org.apache.jmeter.testelement.TestElement
,TestStateListener
,Timer
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
This enum defines the calculation modes used by the ConstantThroughputTimer.Nested classes/interfaces inherited from interface org.apache.jmeter.testelement.TestElement
org.apache.jmeter.testelement.TestElement.Companion
-
Field Summary
Fields inherited from interface org.apache.jmeter.testelement.TestElement
COMMENTS, Companion, ENABLED, GUI_CLASS, NAME, TEST_CLASS
-
Constructor Summary
ConstructorDescriptionConstructor for a non-configured ConstantThroughputTimer. -
Method Summary
Modifier and TypeMethodDescriptionprotected long
calculateCurrentTarget
(long currentTime) Calculate the target time by adding the result of private methodcalculateDelay()
to the givencurrentTime
long
delay()
Retrieve the delay to use during test execution.int
double
Gets the configured desired throughput.void
setCalcMode
(int mode) void
setProperty
(JMeterProperty property) Override the setProperty method in order to convert the original String calcMode property.void
setThroughput
(double throughput) Sets the desired throughput.void
Called once for all threads after the end of a test.void
Called once for all threads after the end of a test.void
Get the timer ready to compute delays for a new test.void
testStarted
(String host) Called just before the start of the test from the main engine thread.toString()
Provide a description of this timer class.Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement
addPropertiesValues, addProperty, addProperty, addTestElement, canRemove, clear, clearTemporary, clearTestElementChildren, clone, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getPropertyOrNull, getSearchableTokens, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, logProperties, mergeIn, propertyIterator, recoverRunningVersion, removeProperty, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse, traverseCollection, traverseMap, traverseProperty
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.jmeter.testelement.TestElement
get, get, get, get, get, get, get, get, get, getOrCreate, getOrCreate, getOrNull, getOrNull, getOrNull, getPropertyOrNull, getProps, getSchema, getString, removed, removeProperty, set, set, set, set, set, set, set, set, set
Methods inherited from interface org.apache.jmeter.timers.Timer
isModifiable
-
Field Details
-
THROUGHPUT
- See Also:
-
CALC_MODE
- See Also:
-
-
Constructor Details
-
ConstantThroughputTimer
public ConstantThroughputTimer()Constructor for a non-configured ConstantThroughputTimer.
-
-
Method Details
-
setThroughput
public void setThroughput(double throughput) Sets the desired throughput.- Parameters:
throughput
- Desired sampling rate, in samples per minute.
-
getThroughput
public double getThroughput()Gets the configured desired throughput.- Returns:
- the rate at which samples should occur, in samples per minute.
-
getCalcMode
public int getCalcMode() -
setCalcMode
public void setCalcMode(int mode) -
delay
public long delay()Retrieve the delay to use during test execution. -
calculateCurrentTarget
protected long calculateCurrentTarget(long currentTime) Calculate the target time by adding the result of private methodcalculateDelay()
to the givencurrentTime
- Parameters:
currentTime
- time in ms- Returns:
- new Target time
-
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. -
testStarted
public void testStarted()Get the timer ready to compute delays for a new test.Called just before the start of the test from the main engine thread. This is before the test elements are cloned. Note that not all the test variables will have been set up at this point.
N.B. testStarted() and testEnded() are called from different threads.
- Specified by:
testStarted
in interfaceTestStateListener
- See Also:
-
setProperty
Override the setProperty method in order to convert the original String calcMode property. This used the locale-dependent display value, so caused problems when the language was changed. Note that the calcMode StringProperty is replaced with an IntegerProperty so the conversion only needs to happen once.- Specified by:
setProperty
in interfaceorg.apache.jmeter.testelement.TestElement
- Overrides:
setProperty
in classAbstractTestElement
-
testEnded
public void testEnded()Called once for all threads after the end of a test. This will use the same element instances as at the start of the test.
N.B. testStarted() and testEnded() are called from different threads.
- Specified by:
testEnded
in interfaceTestStateListener
- See Also:
-
testStarted
Called just before the start of the test from the main engine thread. This is before the test elements are cloned. Note that not all the test variables will have been set up at this point.
N.B. testStarted() and testEnded() are called from different threads.
- Specified by:
testStarted
in interfaceTestStateListener
- Parameters:
host
- name of host- See Also:
-
testEnded
Called once for all threads after the end of a test. This will use the same element instances as at the start of the test.
N.B. testStarted() and testEnded() are called from different threads.
- Specified by:
testEnded
in interfaceTestStateListener
- Parameters:
host
- name of host- See Also:
-