com.sun.faban.driver.engine
Class FixedTime

java.lang.Object
  extended by com.sun.faban.driver.engine.Cycle
      extended by 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

Constructor Summary
FixedTime()
           
 
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
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FixedTime

public FixedTime()
Method Detail

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.