org.apache.qpid.junit.extensions
Class SleepThrottle
java.lang.Object
org.apache.qpid.junit.extensions.BaseThrottle
org.apache.qpid.junit.extensions.SleepThrottle
- All Implemented Interfaces:
- Throttle
public class SleepThrottle
- extends BaseThrottle
- implements Throttle
SleepThrottle is a Throttle implementation that generates short pauses using the thread sleep methods. As the pauses
get shorter, this technique gets more innacurate. In practice, around 100 Hz is the cap rate for accuracy.
CRC Card
Responsibilities | Collaborations
|
---|
Accept throttling rate in operations per second.
|
Inject short pauses to fill out processing cycles to a specified rate.
|
Check against a throttle speed without waiting.
|
Method Summary |
void |
throttle()
This method can only be called at the rate set by the BaseThrottle.setRate(float) method, if it is called faster than this
it will inject short pauses to restrict the call rate to that rate. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SleepThrottle
public SleepThrottle()
throttle
public void throttle()
- This method can only be called at the rate set by the
BaseThrottle.setRate(float)
method, if it is called faster than this
it will inject short pauses to restrict the call rate to that rate.
- Specified by:
throttle
in interface Throttle
Licensed to the Apache Software Foundation