org.objectweb.fractal.jmx.julia.stat
Class ExponentialSmoothingStatController

java.lang.Object
  extended byorg.objectweb.fractal.jmx.julia.stat.BasicStatController
      extended byorg.objectweb.fractal.jmx.julia.stat.ExponentialSmoothingStatController
All Implemented Interfaces:
Initializable, StatController

public class ExponentialSmoothingStatController
extends BasicStatController

Extends BasicStatController with an exponential smoothing method for the rate computation. The rate values returned by this implementation are computed as follows:

            ST = (alpha * xT) + ((1 - alpha) * ST-1)
 
where:

Version:
0.1

Field Summary
protected  double _alpha
          Smoothing constant (default value is 0.5).
 
Fields inherited from class org.objectweb.fractal.jmx.julia.stat.BasicStatController
_period
 
Constructor Summary
ExponentialSmoothingStatController()
           
 
Method Summary
 double getRateOfMethodCall()
          Gets the rate of method calls.
 double getRateOfMethodSuccess()
          Gets the rate of method calls that have "succeded".
 void initialize(Tree args)
          Initializes this object with the given arguments.
 void reset()
          Resets (to zero) the values returned by this controller.
 
Methods inherited from class org.objectweb.fractal.jmx.julia.stat.BasicStatController
getNumberOfMethodCall, getNumberOfMethodSuccess, statPostMethod, statPreMethod
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_alpha

protected double _alpha
Smoothing constant (default value is 0.5).

Its value must be in the interval [0-1] and can be fixed by initialize.

Constructor Detail

ExponentialSmoothingStatController

public ExponentialSmoothingStatController()
Method Detail

initialize

public void initialize(Tree args)
Initializes this object with the given arguments. The first subtree (if any) must represent the value of period. The second subtree (if any) must represent the value of the smoothing constant.

Specified by:
initialize in interface Initializable
Overrides:
initialize in class BasicStatController
Parameters:
args - the arguments to be used to initialize this object.
Throws:
NumberFormatException - if the first subtree is not a valid string representation of a long value, or if the second subtree is not a valid string representation of a double value.
IllegalStateException - if the firts subtree does not represent a positive value or if the second subtree does not represent a value in the interval [0-1].

getRateOfMethodCall

public double getRateOfMethodCall()
Description copied from interface: StatController
Gets the rate of method calls.

Specified by:
getRateOfMethodCall in interface StatController
Overrides:
getRateOfMethodCall in class BasicStatController

getRateOfMethodSuccess

public double getRateOfMethodSuccess()
Description copied from interface: StatController
Gets the rate of method calls that have "succeded".

Specified by:
getRateOfMethodSuccess in interface StatController
Overrides:
getRateOfMethodSuccess in class BasicStatController

reset

public void reset()
Description copied from interface: StatController
Resets (to zero) the values returned by this controller.

Specified by:
reset in interface StatController
Overrides:
reset in class BasicStatController