|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.TimerTask
fr.dyade.aaa.common.AverageLoadTask
public abstract class AverageLoadTask
This class computes the load average of the server using Unix algorithm. This task needs is scheduled every 5 seconds.
Field Summary | |
---|---|
(package private) long |
averageLoad1
load averages for the last minute. |
(package private) long |
averageLoad15
load averages for the past 15 minutes. |
(package private) long |
averageLoad5
load averages for the past 5 minutes. |
private static long |
EXP_1
1/exp(5sec/1min) as fixed-point |
private static long |
EXP_15
1/exp(5sec/15min) |
private static long |
EXP_5
1/exp(5sec/5min) |
private static long |
FIXED_1
1.0 as fixed-point |
private static long |
FSHIFT
number of bits of precision |
Constructor Summary | |
---|---|
AverageLoadTask()
|
Method Summary | |
---|---|
(package private) long |
computeLoad(long load,
long exp,
long n)
|
(package private) float |
convert(long average)
|
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 |
Field Detail |
---|
private static long FSHIFT
private static long FIXED_1
private static long EXP_1
private static long EXP_5
private static long EXP_15
long averageLoad1
long averageLoad5
long averageLoad15
Constructor Detail |
---|
public AverageLoadTask()
Method Detail |
---|
public float getAverageLoad1()
public float getAverageLoad5()
public float getAverageLoad15()
float convert(long average)
long computeLoad(long load, long exp, long n)
protected abstract long countActiveTasks()
public void run()
run
in interface java.lang.Runnable
run
in class java.util.TimerTask
TimerTask.run()
protected final void start(java.util.Timer timer)
timer
- Timer to use to schedule the resulting task.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |