Package org.apache.zookeeper.server.util
Class JvmPauseMonitor
- java.lang.Object
- 
- org.apache.zookeeper.server.util.JvmPauseMonitor
 
- 
 public class JvmPauseMonitor extends Object This code is originally from hadoop-common, see: https://github.com/apache/hadoop/blob/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/JvmPauseMonitor.java Class which sets up a simple thread which runs in a loop sleeping for a short interval of time. If the sleep takes significantly longer than its target time, it implies that the JVM or host machine has paused processing, which may cause other problems. If such a pause is detected, the thread logs a message.
- 
- 
Field SummaryFields Modifier and Type Field Description static longINFO_THRESHOLD_DEFAULTstatic StringINFO_THRESHOLD_KEYprotected longinfoThresholdMslog INFO if we detect a pause longer than this thresholdstatic StringJVM_PAUSE_MONITOR_FEATURE_SWITCH_KEYstatic longSLEEP_TIME_MS_DEFAULTstatic StringSLEEP_TIME_MS_KEYprotected longsleepTimeMsThe target sleep timestatic longWARN_THRESHOLD_DEFAULTstatic StringWARN_THRESHOLD_KEYprotected longwarnThresholdMslog WARN if we detect a pause longer than this threshold
 - 
Constructor SummaryConstructors Constructor Description JvmPauseMonitor(QuorumPeerConfig config)JvmPauseMonitor(ServerConfig config)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetNumGcInfoThresholdExceeded()longgetNumGcWarnThresholdExceeded()longgetTotalGcExtraSleepTime()booleanisStarted()voidserviceStart()voidserviceStop()
 
- 
- 
- 
Field Detail- 
JVM_PAUSE_MONITOR_FEATURE_SWITCH_KEYpublic static final String JVM_PAUSE_MONITOR_FEATURE_SWITCH_KEY - See Also:
- Constant Field Values
 
 - 
sleepTimeMsprotected long sleepTimeMs The target sleep time
 - 
SLEEP_TIME_MS_KEYpublic static final String SLEEP_TIME_MS_KEY - See Also:
- Constant Field Values
 
 - 
SLEEP_TIME_MS_DEFAULTpublic static final long SLEEP_TIME_MS_DEFAULT - See Also:
- Constant Field Values
 
 - 
warnThresholdMsprotected long warnThresholdMs log WARN if we detect a pause longer than this threshold
 - 
WARN_THRESHOLD_KEYpublic static final String WARN_THRESHOLD_KEY - See Also:
- Constant Field Values
 
 - 
WARN_THRESHOLD_DEFAULTpublic static final long WARN_THRESHOLD_DEFAULT - See Also:
- Constant Field Values
 
 - 
infoThresholdMsprotected long infoThresholdMs log INFO if we detect a pause longer than this threshold
 - 
INFO_THRESHOLD_KEYpublic static final String INFO_THRESHOLD_KEY - See Also:
- Constant Field Values
 
 - 
INFO_THRESHOLD_DEFAULTpublic static final long INFO_THRESHOLD_DEFAULT - See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
JvmPauseMonitorpublic JvmPauseMonitor(QuorumPeerConfig config) 
 - 
JvmPauseMonitorpublic JvmPauseMonitor(ServerConfig config) 
 
- 
 - 
Method Detail- 
serviceStartpublic void serviceStart() 
 - 
serviceStoppublic void serviceStop() 
 - 
isStartedpublic boolean isStarted() 
 - 
getNumGcWarnThresholdExceededpublic long getNumGcWarnThresholdExceeded() 
 - 
getNumGcInfoThresholdExceededpublic long getNumGcInfoThresholdExceeded() 
 - 
getTotalGcExtraSleepTimepublic long getTotalGcExtraSleepTime() 
 
- 
 
-