Package org.apache.jmeter.timers
Class ConstantThroughputTimer
java.lang.Object
org.apache.jmeter.testelement.AbstractTestElement
org.apache.jmeter.timers.ConstantThroughputTimer
- All Implemented Interfaces:
- Serializable,- Cloneable,- Searchable,- TestBean,- org.apache.jmeter.testelement.TestElement,- Timer
This class implements a constant throughput timer. A Constant Throughput
 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
- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic enumThis enum defines the calculation modes used by the ConstantThroughputTimer.Nested classes/interfaces inherited from interface org.apache.jmeter.testelement.TestElementorg.apache.jmeter.testelement.TestElement.Companion
- 
Field SummaryFieldsFields inherited from interface org.apache.jmeter.testelement.TestElementCOMMENTS, Companion, ENABLED, GUI_CLASS, NAME, TEST_CLASS
- 
Constructor SummaryConstructorsConstructorDescriptionConstructor for a non-configured ConstantThroughputTimer.
- 
Method SummaryModifier and TypeMethodDescriptionprotected longcalculateCurrentTarget(long currentTime) Calculate the target time by adding the result of private methodcalculateDelay()to the givencurrentTimelongdelay()Retrieve the delay to use during test execution.intdoubleGets the configured desired throughput.voidsetCalcMode(int mode) voidsetProperty(JMeterProperty property) Override the setProperty method in order to convert the original String calcMode property.voidsetThroughput(double throughput) Sets the desired throughput.toString()Provide a description of this timer class.Methods inherited from class org.apache.jmeter.testelement.AbstractTestElementaddPropertiesValues, 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, traversePropertyMethods inherited from class java.lang.Objectfinalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.jmeter.testelement.TestElementget, 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, setMethods inherited from interface org.apache.jmeter.timers.TimerisModifiable
- 
Field Details- 
THROUGHPUT- See Also:
 
- 
CALC_MODE- See Also:
 
 
- 
- 
Constructor Details- 
ConstantThroughputTimerpublic ConstantThroughputTimer()Constructor for a non-configured ConstantThroughputTimer.
 
- 
- 
Method Details- 
setThroughputpublic void setThroughput(double throughput) Sets the desired throughput.- Parameters:
- throughput- Desired sampling rate, in samples per minute.
 
- 
getThroughputpublic double getThroughput()Gets the configured desired throughput.- Returns:
- the rate at which samples should occur, in samples per minute.
 
- 
getCalcModepublic int getCalcMode()
- 
setCalcModepublic void setCalcMode(int mode) 
- 
delaypublic long delay()Retrieve the delay to use during test execution.
- 
calculateCurrentTargetprotected 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
 
- 
toStringProvide 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.
- 
setPropertyOverride 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:
- setPropertyin interface- org.apache.jmeter.testelement.TestElement
- Overrides:
- setPropertyin class- AbstractTestElement
 
 
-