Package alluxio.util

Class 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.
    • 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 pauses
        warnThresholdMs - when gc pauses exceeds this time in milliseconds log WARN
        infoThresholdMs - 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