com.sun.faban.driver.engine
Class FixedTime
java.lang.Object
com.sun.faban.driver.engine.Cycle
com.sun.faban.driver.engine.FixedTime
- All Implemented Interfaces:
- Serializable, Cloneable
public class FixedTime
- extends Cycle
Implements the fixed time setting for an operation.
- Author:
- Akara Sucharitakul
- See Also:
- Serialized Form
Method Summary |
long |
getDelay(Random random)
Returns a delay time for the thread. |
double |
getHistogramMax()
Provides the maximum value to be represented inside a histogram. |
void |
init(Annotation a)
Initializes this cycle according to the annotation. |
Methods inherited from class com.sun.faban.driver.engine.Cycle |
clone |
FixedTime
public FixedTime()
init
public void init(Annotation a)
throws DefinitionException
- Initializes this cycle according to the annotation.
- Specified by:
init
in class Cycle
- Parameters:
a
- The annotation
- Throws:
DefinitionException
- If there is an error in the annotation
getDelay
public long getDelay(Random random)
- Returns a delay time for the thread. The initial delay time
returned is randomly selected between 0 and the set cycle time.
The subsequent times are exactly the cycle time. This is to
prevent thundering of operations when using @FixedTime.
- Specified by:
getDelay
in class Cycle
- Parameters:
random
- The random number generator used
- Returns:
- The delay time
getHistogramMax
public double getHistogramMax()
- Provides the maximum value to be represented inside a histogram.
- Specified by:
getHistogramMax
in class Cycle
- Returns:
- The max reasonable delay to be presented in the output histogram.