Class ConstantThroughputTimer

All Implemented Interfaces:
Serializable, Cloneable, Searchable, TestBean, org.apache.jmeter.testelement.TestElement, Timer

public class ConstantThroughputTimer extends AbstractTestElement implements Timer, TestBean
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:
  • Field Details

  • Constructor Details

    • ConstantThroughputTimer

      public ConstantThroughputTimer()
      Constructor for a non-configured ConstantThroughputTimer.
  • Method Details

    • setThroughput

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

      public double getThroughput()
      Gets the configured desired throughput.
      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.
      Specified by:
      delay in interface Timer
      the computed delay value.
      See Also:
    • calculateCurrentTarget

      protected long calculateCurrentTarget(long currentTime)
      Calculate the target time by adding the result of private method calculateDelay() to the given currentTime
      currentTime - time in ms
      new Target time
    • 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.
      toString in class Object
      the description of this timer class.
    • setProperty

      public void setProperty(JMeterProperty property)
      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 interface org.apache.jmeter.testelement.TestElement
      setProperty in class AbstractTestElement