com.palantir.opensource.sysmon.linux
Class LinuxLoadAverageJMXWrapper

java.lang.Object
  extended by java.lang.Thread
      extended by com.palantir.opensource.sysmon.linux.LinuxLoadAverageJMXWrapper
All Implemented Interfaces:
Monitor, Runnable

public class LinuxLoadAverageJMXWrapper
extends Thread
implements Monitor

Monitors load average. Requires the uptime utility.

Reads the output from 'uptime' that looks like this:

  13:22:52 up 18 days, 20:51,  3 users,  load average: 0.31, 0.14, 0.10
 

Currently, the uptime data from uptime is not processed.

JMX Data Path

sysmon.linux.beanpath:type=LoadAverage

Configuration parameters

Note that any value not set in the config file will use the default value.
Config KeyDescriptionDefault ValueConstant
sysmon.linux.uptime.path path to uptime binary uptime CONFIG_KEY_UPTIME_PATH
sysmon.linux.uptime.period period, in seconds, between load average checks 10 CONFIG_KEY_UPTIME_PERIOD

See Also:
Lifecycle documentation

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
static String CONFIG_KEY_UPTIME_PATH
          Config key for the path to uptime.
static String CONFIG_KEY_UPTIME_PERIOD
          Config key for the period, in seconds, to pass to uptime.
static String DEFAULT_UPTIME_PATH
          Default path to find uptime.
static Integer DEFAULT_UPTIME_PERIOD
          Default period, in seconds.
static String OBJECT_NAME
           
static Pattern UPTIME_DATA
          Pattern for parsing uptime data.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
LinuxLoadAverageJMXWrapper(Properties config)
           
 
Method Summary
 void run()
           
 void startMonitoring()
           
 void stopMonitoring()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CONFIG_KEY_UPTIME_PATH

public static final String CONFIG_KEY_UPTIME_PATH
Config key for the path to uptime. Key: "sysmon.linux.uptime.path"

See Also:
Constant Field Values

CONFIG_KEY_UPTIME_PERIOD

public static final String CONFIG_KEY_UPTIME_PERIOD
Config key for the period, in seconds, to pass to uptime. Key: "sysmon.linux.uptime.period"

See Also:
Constant Field Values

DEFAULT_UPTIME_PATH

public static final String DEFAULT_UPTIME_PATH
Default path to find uptime. Defaults to 'uptime', so that the shell can figure it via its $PATH. Default: "uptime"

See Also:
for config key used to override the default path, Constant Field Values

DEFAULT_UPTIME_PERIOD

public static final Integer DEFAULT_UPTIME_PERIOD
Default period, in seconds. Default:

See Also:
for config key used to override the default period

UPTIME_DATA

public static final Pattern UPTIME_DATA
Pattern for parsing uptime data.


OBJECT_NAME

public static final String OBJECT_NAME
See Also:
Constant Field Values
Constructor Detail

LinuxLoadAverageJMXWrapper

public LinuxLoadAverageJMXWrapper(Properties config)
                           throws LinuxMonitoringException
Throws:
LinuxMonitoringException
Method Detail

startMonitoring

public void startMonitoring()
                     throws SysmonException
Specified by:
startMonitoring in interface Monitor
Throws:
SysmonException

stopMonitoring

public void stopMonitoring()
                    throws InterruptedException
Specified by:
stopMonitoring in interface Monitor
Throws:
InterruptedException

run

public void run()
Specified by:
run in interface Runnable
Overrides:
run in class Thread


Copyright © 2012 Palantir Technologies. All Rights Reserved.