|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
com.palantir.opensource.sysmon.linux.LinuxNetStatJMXWrapper
public class LinuxNetStatJMXWrapper
Monitors network interface statistics.
This class reads information from/proc/net/dev to publish statistics via
per-interface beans.
sysmon.linux.beanpath:type=net-device,devicename=<devicename>
| Config Key | Description | Default Value | Constant |
|---|---|---|---|
| sysmon.linux.netstat.periodMillis | period, in milliseconds, between interface statistics checks | 2000 |
CONFIG_KEY_NETSTAT_PERIOD |
Lifecycle documentation,
proc(5) for information on /proc/net/dev| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
static String |
CONFIG_KEY_NETSTAT_PERIOD
Configuration parameter that controls the time between checks for this monitor. |
static long |
DEFAULT_NETSTAT_PERIOD
Default value for how often to update values, in milliseconds. |
static Pattern |
FIRST_LINE
Compiled Pattern to match the first header line in the /proc/net/dev files |
static String |
FIRST_LINE_RE
Regex string to match the first header line in the /proc/net/dev files |
static String |
OBJECT_NAME_PREFIX
|
static Pattern |
SECOND_LINE
Compiled Pattern to match the second header line in the /proc/net/dev files |
static String |
SECOND_LINE_RE
Regex string to match the second header line in the /proc/net/dev files |
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
LinuxNetStatJMXWrapper(Properties config)
Constructs a new monitor. |
|
| Method Summary | |
|---|---|
void |
cleanup()
|
void |
run()
|
void |
startMonitoring()
Starts the background thread that does the work of this monitor. |
void |
stopMonitoring()
Shuts down the background thread that does the work of this monitor. |
| 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_NETSTAT_PERIOD
default value,
Constant Field Valuespublic static final String FIRST_LINE_RE
public static final Pattern FIRST_LINE
Pattern to match the first header line in the /proc/net/dev files
public static final String SECOND_LINE_RE
public static final Pattern SECOND_LINE
Pattern to match the second header line in the /proc/net/dev files
public static final long DEFAULT_NETSTAT_PERIOD
for config key to override default value.,
Constant Field Valuespublic static final String OBJECT_NAME_PREFIX
| Constructor Detail |
|---|
public LinuxNetStatJMXWrapper(Properties config)
throws LinuxMonitoringException
config -
LinuxMonitoringException| Method Detail |
|---|
public void startMonitoring()
startMonitoring in interface Monitor
public void stopMonitoring()
throws InterruptedException
stopMonitoring in interface MonitorInterruptedException - if interrupted while waiting for
background thread to exit.public void run()
run in interface Runnablerun in class Threadpublic void cleanup()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||