Package alluxio.util
Class JvmPauseMonitor
- java.lang.Object
-
- alluxio.util.JvmPauseMonitor
-
@NotThreadSafe public class JvmPauseMonitor extends java.lang.Object
Class to monitor JVM with a daemon thread, the thread sleep period of time and get the true time the sleep takes. If it is longer than it should be, the JVM has paused processing. Then log it into different level.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JvmPauseMonitor.GarbageCollectorMXBeanView
An unmodifiable view of a garbage collector MX Bean.
-
Constructor Summary
Constructors Constructor Description JvmPauseMonitor(long gcSleepIntervalMs, long warnThresholdMs, long infoThresholdMs)
Constructs JvmPauseMonitor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getInfoTimeExceeded()
long
getTotalExtraTime()
long
getWarnTimeExceeded()
boolean
isStarted()
void
start()
Starts jvm monitor thread.void
stop()
Stops jvm monitor.
-
-
-
Constructor Detail
-
JvmPauseMonitor
public JvmPauseMonitor(long gcSleepIntervalMs, long warnThresholdMs, long infoThresholdMs)
Constructs JvmPauseMonitor.- Parameters:
gcSleepIntervalMs
- The time in milliseconds to sleep for in checking for GC pauseswarnThresholdMs
- when gc pauses exceeds this time in milliseconds log WARNinfoThresholdMs
- when gc pauses exceeds this time in milliseconds log INFO
-
-
Method Detail
-
start
public void start()
Starts jvm monitor thread.
-
stop
public void stop()
Stops jvm monitor.
-
isStarted
public boolean isStarted()
- Returns:
- true if thread started, false otherwise
-
getWarnTimeExceeded
public long getWarnTimeExceeded()
- Returns:
- time exceeds WARN threshold in milliseconds
-
getInfoTimeExceeded
public long getInfoTimeExceeded()
- Returns:
- time exceeds INFO threshold in milliseconds
-
getTotalExtraTime
public long getTotalExtraTime()
- Returns:
- Total extra time in milliseconds
-
-