Package org.apache.zookeeper.server.util
Class JvmPauseMonitor
java.lang.Object
org.apache.zookeeper.server.util.JvmPauseMonitor
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final long
static final String
protected long
log INFO if we detect a pause longer than this thresholdstatic final String
static final long
static final String
protected long
The target sleep timestatic final long
static final String
protected long
log WARN if we detect a pause longer than this threshold -
Constructor Summary
ConstructorsConstructorDescriptionJvmPauseMonitor
(QuorumPeerConfig config) JvmPauseMonitor
(ServerConfig config) -
Method Summary
Modifier and TypeMethodDescriptionlong
long
long
boolean
void
void
-
Field Details
-
JVM_PAUSE_MONITOR_FEATURE_SWITCH_KEY
- See Also:
-
sleepTimeMs
protected long sleepTimeMsThe target sleep time -
SLEEP_TIME_MS_KEY
- See Also:
-
SLEEP_TIME_MS_DEFAULT
public static final long SLEEP_TIME_MS_DEFAULT- See Also:
-
warnThresholdMs
protected long warnThresholdMslog WARN if we detect a pause longer than this threshold -
WARN_THRESHOLD_KEY
- See Also:
-
WARN_THRESHOLD_DEFAULT
public static final long WARN_THRESHOLD_DEFAULT- See Also:
-
infoThresholdMs
protected long infoThresholdMslog INFO if we detect a pause longer than this threshold -
INFO_THRESHOLD_KEY
- See Also:
-
INFO_THRESHOLD_DEFAULT
public static final long INFO_THRESHOLD_DEFAULT- See Also:
-
-
Constructor Details
-
JvmPauseMonitor
-
JvmPauseMonitor
-
-
Method Details
-
serviceStart
public void serviceStart() -
serviceStop
public void serviceStop() -
isStarted
public boolean isStarted() -
getNumGcWarnThresholdExceeded
public long getNumGcWarnThresholdExceeded() -
getNumGcInfoThresholdExceeded
public long getNumGcInfoThresholdExceeded() -
getTotalGcExtraSleepTime
public long getTotalGcExtraSleepTime()
-