|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread com.palantir.opensource.sysmon.linux.LinuxIOStatJMXWrapper
public class LinuxIOStatJMXWrapper
Monitors I/O statistics as reported by iostat
This class that fires up iostat in a background process, reads its output, and publishes it via JMX MBeans.
sysmon.linux.beanpath:type=io-device,devicename=<devicename>
Config Key | Description | Default Value | Constant |
---|---|---|---|
sysmon.linux.iostat.path | path to iostat binary |
iostat |
CONFIG_KEY_IOSTAT_PATH |
sysmon.linux.iostat.opts | options passed to iostat | -d -x -k |
CONFIG_KEY_IOSTAT_OPTIONS |
sysmon.linux.iostat.period | period, in seconds, between iostat reports | 60 |
CONFIG_KEY_IOSTAT_PERIOD |
Lifecycle documentation
,
iostat(1) for more information on iostat
.Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
static String |
CONFIG_KEY_IOSTAT_OPTIONS
Options passed to iostat (other than period argument). |
static String |
CONFIG_KEY_IOSTAT_PATH
Path to iostat executable. |
static String |
CONFIG_KEY_IOSTAT_PERIOD
Period for iostat. |
static String |
DEFAULT_IOSTAT_OPTIONS
Default options passed to iostat executable. |
static String |
DEFAULT_IOSTAT_PATH
Default path to iostat executable. |
static Integer |
DEFAULT_IOSTAT_PERIOD
Default period between iostat output (in seconds). |
static Pattern |
FIRST_LINE_PREFIX
|
static String |
OBJECT_NAME_PREFIX
Relative JMX data path where this monitor publishes its data. |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
LinuxIOStatJMXWrapper(Properties config)
Constructs a new iostat JMX wrapper. |
Method Summary | |
---|---|
void |
run()
|
void |
startMonitoring()
Start iostat as a background process and makes sure header output parses correctly. |
void |
stopMonitoring()
Shuts down and cleans up both background iostat process and data reading thread. |
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 |
---|
public static final String CONFIG_KEY_IOSTAT_PATH
default value for this config parameter
,
iostat(1) on your local linux box,
Constant Field Valuespublic static final String CONFIG_KEY_IOSTAT_OPTIONS
Options passed to iostat
(other than period argument).
Note that passing config values that
change the format of the output from iostat
may break this monitor. Proceed
with caution.
Set this key in the config file to override default values.
Config key: "sysmon.linux.iostat.opts"
default value for this config parameter
,
iostat(1) on your local linux box,
Constant Field Valuespublic static final String CONFIG_KEY_IOSTAT_PERIOD
default value for this config parameter
,
iostat(1) on your local linux box,
Constant Field Valuespublic static final String DEFAULT_IOSTAT_PATH
instructions on overriding this value.
,
iostat(1) on your local linux box,
Constant Field Valuespublic static final String DEFAULT_IOSTAT_OPTIONS
instructions on overriding this value.
,
iostat(1) on your local linux box,
Constant Field Valuespublic static final Integer DEFAULT_IOSTAT_PERIOD
Instructions on overriding this value.
,
iostat(1) on your local linux boxpublic static final String OBJECT_NAME_PREFIX
public static final Pattern FIRST_LINE_PREFIX
Constructor Detail |
---|
public LinuxIOStatJMXWrapper(Properties config) throws LinuxMonitoringException
startMonitoring()
to start monitoring and publishing
JMX data.
config
- configuration for this service
LinuxMonitoringException
- upon error in setting up this service.CONFIG_KEY_IOSTAT_OPTIONS
,
CONFIG_KEY_IOSTAT_PATH
,
CONFIG_KEY_IOSTAT_PERIOD
Method Detail |
---|
public void startMonitoring() throws LinuxMonitoringException
startMonitoring
in interface Monitor
LinuxMonitoringException
- upon error with iostat startup.public void stopMonitoring() throws InterruptedException
stopMonitoring
in interface Monitor
InterruptedException
public void run()
run
in interface Runnable
run
in class Thread
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |