public abstract class AverageLoadTask extends TimerTask
Modifier and Type | Field and Description |
---|---|
(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 and Description |
---|
AverageLoadTask() |
Modifier and Type | Method and Description |
---|---|
(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 |
reset() |
void |
run() |
protected void |
start(Timer timer)
Starts the resulting task.
|
cancel, scheduledExecutionTime
private static final long FSHIFT
private static final long FIXED_1
private static final long EXP_1
private static final long EXP_5
private static final long EXP_15
long averageLoad1
long averageLoad5
long averageLoad15
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 Runnable
run
in class TimerTask
TimerTask.run()
public void reset()
protected final void start(Timer timer)
timer
- Timer to use to schedule the resulting task.Copyright © 2018 ScalAgent D.T.. All Rights Reserved.