com.palantir.opensource.sysmon.linux
Class LinuxVMStatJMXWrapper

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

public class LinuxVMStatJMXWrapper
extends Thread
implements Monitor

Monitors system performance statistics as generated by vmstat.

vmstat reports information about processes, memory, paging, block IO, traps, and cpu activity.

JMX Data Path

sysmon.linux.beanpath:type=linux-vmstat

Configuration parameters

Note that any value not set in the config file will use the default value.
Config KeyDescriptionDefault ValueConstant
sysmon.linux.vmstat.path path to vmstat binary vmstat CONFIG_KEY_VMSTAT_PATH
sysmon.linux.vmstat.opts options passed to vmstat -n CONFIG_KEY_VMSTAT_OPTIONS
sysmon.linux.vmstat.period period in seconds between vmstat data runs 60 CONFIG_KEY_VMSTAT_PERIOD

See Also:
Lifecycle documentation, vmstat(8) man page

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
static String BEAN_TYPE
          This bean will be mounted at the passed path with type of ":type=linux-vmstat"
static String CONFIG_KEY_VMSTAT_OPTIONS
          Options passed to vmstat (other than period argument).
static String CONFIG_KEY_VMSTAT_PATH
          Path to vmstat executable.
static String CONFIG_KEY_VMSTAT_PERIOD
          Period for vmstat.
static String DEFAULT_VMSTAT_OPTIONS
          Default options for vmstat.
static String DEFAULT_VMSTAT_PATH
          Defaults to using a bare path to allow $PATH to find the vmstat executable.
static Integer DEFAULT_VMSTAT_PERIOD
          Default for vmstat reporting period.
static String OBJECT_NAME
          Added to the bean path to find the place to hang the vmstat data.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
LinuxVMStatJMXWrapper(Properties config)
          Constructs (but does not start) a new instance of this monitor.
 
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_VMSTAT_PATH

public static final String CONFIG_KEY_VMSTAT_PATH
Path to vmstat executable. Defaults to "vmstat" (uses $PATH to find executable). Set this config value in the to override where to find vmstat. Config key: "sysmon.linux.vmstat.path"

See Also:
default value for this config parameter, vmstat(8) on your local linux box, Constant Field Values

CONFIG_KEY_VMSTAT_OPTIONS

public static final String CONFIG_KEY_VMSTAT_OPTIONS
Options passed to vmstat (other than period argument). Set this key in config file to override defaults options. Config key: "sysmon.linux.vmstat.opts"

See Also:
DEFAULT_VMSTAT_OPTIONS, vmstat(8) on your local linux box, Constant Field Values

CONFIG_KEY_VMSTAT_PERIOD

public static final String CONFIG_KEY_VMSTAT_PERIOD
Period for vmstat. Set this config value to override how often vmstat is outputting values. Config key: "sysmon.linux.vmstat.period"

See Also:
DEFAULT_VMSTAT_PERIOD, vmstat(8) on your local linux box, Constant Field Values

DEFAULT_VMSTAT_PATH

public static final String DEFAULT_VMSTAT_PATH
Defaults to using a bare path to allow $PATH to find the vmstat executable. Default value: "vmstat"

See Also:
how to override the default, Constant Field Values

DEFAULT_VMSTAT_OPTIONS

public static final String DEFAULT_VMSTAT_OPTIONS
Default options for vmstat. Default value: "-n"

See Also:
how to override the default, Constant Field Values

DEFAULT_VMSTAT_PERIOD

public static final Integer DEFAULT_VMSTAT_PERIOD
Default for vmstat reporting period. Default value:

See Also:
how to override the default config value

OBJECT_NAME

public static final String OBJECT_NAME
Added to the bean path to find the place to hang the vmstat data.

See Also:
for information on the bean path., Constant Field Values

BEAN_TYPE

public static final String BEAN_TYPE
This bean will be mounted at the passed path with type of ":type=linux-vmstat"

See Also:
Constant Field Values
Constructor Detail

LinuxVMStatJMXWrapper

public LinuxVMStatJMXWrapper(Properties config)
                      throws LinuxMonitoringException
Constructs (but does not start) a new instance of this monitor. You must call startMonitoring() to start the monitor and start taking data.

Parameters:
config - configuration for this monitor. Will not be modified.
Throws:
JMException - on an error with JMX server operations (usually related to MXBean naming).
LinuxMonitoringException - on misconfiguration of the monitor itself.
Method Detail

startMonitoring

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

run

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

stopMonitoring

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


Copyright © 2012 Palantir Technologies. All Rights Reserved.