org.objectweb.proactive.core.util.timer
Class EWMATimer

java.lang.Object
  extended byorg.objectweb.proactive.core.util.timer.AverageMicroTimer
      extended byorg.objectweb.proactive.core.util.timer.EWMATimer
All Implemented Interfaces:
java.io.Serializable, Timer

public class EWMATimer
extends AverageMicroTimer

A timer where we compute an exponentially weighted moving average i.e average(n)=average(n-1)*alpha+(1-alpha)*value(n)

See Also:
Serialized Form

Field Summary
protected  double alpha
           
protected  double average
           
 
Fields inherited from class org.objectweb.proactive.core.util.timer.AverageMicroTimer
currentElapsed, name, nbrValues, running, timer, total
 
Constructor Summary
EWMATimer(java.lang.String s, double alpha)
           
 
Method Summary
 double getAverage()
          return the average time measured so far
static void main(java.lang.String[] args)
           
 void reset()
           
 void stop()
          stop the timer and use the cumulated time to compute the average
 
Methods inherited from class org.objectweb.proactive.core.util.timer.AverageMicroTimer
dump, getCumulatedTime, getName, getNumberOfValues, pause, resume, setName, start, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

alpha

protected double alpha

average

protected double average
Constructor Detail

EWMATimer

public EWMATimer(java.lang.String s,
                 double alpha)
Method Detail

stop

public void stop()
Description copied from class: AverageMicroTimer
stop the timer and use the cumulated time to compute the average

Specified by:
stop in interface Timer
Overrides:
stop in class AverageMicroTimer

getAverage

public double getAverage()
Description copied from class: AverageMicroTimer
return the average time measured so far

Specified by:
getAverage in interface Timer
Overrides:
getAverage in class AverageMicroTimer
Returns:
the average time in microseconds -1 if NaN

reset

public void reset()
Specified by:
reset in interface Timer
Overrides:
reset in class AverageMicroTimer

main

public static void main(java.lang.String[] args)


Copyright ? April 2005 INRIA All Rights Reserved.