fr.dyade.aaa.common
Class AverageLoadTask

java.lang.Object
  extended by java.util.TimerTask
      extended by fr.dyade.aaa.common.AverageLoadTask
All Implemented Interfaces:
java.lang.Runnable

public abstract class AverageLoadTask
extends java.util.TimerTask

This class computes the load average of the server using Unix algorithm. This task needs is scheduled every 5 seconds.


Constructor Summary
AverageLoadTask()
           
 
Method Summary
protected abstract  long countActiveTasks()
           
 float getAverageLoad1()
          Returns the load averages for the last minute.
 float getAverageLoad15()
          Returns the load averages for the past 15 minutes.
 float getAverageLoad5()
          Returns the load averages for the past 5 minutes.
 void run()
           
protected  void start(java.util.Timer timer)
          Starts the resulting task.
 
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AverageLoadTask

public AverageLoadTask()
Method Detail

getAverageLoad1

public float getAverageLoad1()
Returns the load averages for the last minute.

Returns:
the load averages for the last minute.

getAverageLoad5

public float getAverageLoad5()
Returns the load averages for the past 5 minutes.

Returns:
the load averages for the past 5 minutes.

getAverageLoad15

public float getAverageLoad15()
Returns the load averages for the past 15 minutes.

Returns:
the load averages for the past 15 minutes.

countActiveTasks

protected abstract long countActiveTasks()

run

public void run()
Specified by:
run in interface java.lang.Runnable
Specified by:
run in class java.util.TimerTask
See Also:
TimerTask.run()

start

protected final void start(java.util.Timer timer)
Starts the resulting task.

Parameters:
timer - Timer to use to schedule the resulting task.


Copyright © 2011 ScalAgent D.T.. All Rights Reserved.