net.floodlightcontroller.util
Class LoadMonitor

java.lang.Object
  extended by net.floodlightcontroller.util.LoadMonitor
All Implemented Interfaces:
java.lang.Runnable

public class LoadMonitor
extends java.lang.Object
implements java.lang.Runnable


Nested Class Summary
static class LoadMonitor.LoadLevel
           
 
Field Summary
protected  boolean isLinux
           
protected  int itersLoaded
           
protected  int jiffyNanos
           
protected  long[] lastIdle
           
protected  long[] lastNanos
           
protected  double load
           
protected  LoadMonitor.LoadLevel loadlevel
           
static int LOADMONITOR_SAMPLING_INTERVAL
           
protected  org.slf4j.Logger log
           
static int MAX_LOAD_HISTORY
           
static int MAX_LOADED_ITERATIONS
           
protected  int numcores
           
static double THRESHOLD_HIGH
           
static double THRESHOLD_VERYHIGH
           
 
Constructor Summary
LoadMonitor(org.slf4j.Logger log_)
           
 
Method Summary
 double getLoad()
           
 LoadMonitor.LoadLevel getLoadLevel()
           
static void main(java.lang.String[] args)
           
 java.util.concurrent.ScheduledFuture<?> printMonitoring(java.util.concurrent.ScheduledExecutorService ses)
           
protected  long readIdle()
           
 void run()
           
protected  java.lang.String runcmd(java.lang.String cmd)
           
 java.util.concurrent.ScheduledFuture<?> startMonitoring(java.util.concurrent.ScheduledExecutorService ses)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOADMONITOR_SAMPLING_INTERVAL

public static final int LOADMONITOR_SAMPLING_INTERVAL
See Also:
Constant Field Values

THRESHOLD_HIGH

public static final double THRESHOLD_HIGH
See Also:
Constant Field Values

THRESHOLD_VERYHIGH

public static final double THRESHOLD_VERYHIGH
See Also:
Constant Field Values

MAX_LOADED_ITERATIONS

public static final int MAX_LOADED_ITERATIONS
See Also:
Constant Field Values

MAX_LOAD_HISTORY

public static final int MAX_LOAD_HISTORY
See Also:
Constant Field Values

load

protected volatile double load

loadlevel

protected volatile LoadMonitor.LoadLevel loadlevel

itersLoaded

protected int itersLoaded

isLinux

protected boolean isLinux

numcores

protected int numcores

jiffyNanos

protected int jiffyNanos

lastNanos

protected long[] lastNanos

lastIdle

protected long[] lastIdle

log

protected org.slf4j.Logger log
Constructor Detail

LoadMonitor

public LoadMonitor(org.slf4j.Logger log_)
Method Detail

getLoadLevel

public LoadMonitor.LoadLevel getLoadLevel()

getLoad

public double getLoad()

run

public void run()
Specified by:
run in interface java.lang.Runnable

runcmd

protected java.lang.String runcmd(java.lang.String cmd)

readIdle

protected long readIdle()

startMonitoring

public java.util.concurrent.ScheduledFuture<?> startMonitoring(java.util.concurrent.ScheduledExecutorService ses)

printMonitoring

public java.util.concurrent.ScheduledFuture<?> printMonitoring(java.util.concurrent.ScheduledExecutorService ses)

main

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