public static final String JVM_PAUSE_INFO = "jvm.pause.info-threshold";
public static final String JVM_PAUSE_WARN = "jvm.pause.warn-threshold";
public static final String JVM_EXTRA_SLEEP = "jvm.pause.extraSleepTime";
1
2
3
(2)HiveMetaStore
public synchronized void init(HiveConf hiveConf) {
//Initialize metrics first, as some metrics are for initialization stuff.
try {
if (hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_METRICS_ENABLED)) {
MetricsFactory.init(hiveConf);
}
} catch (Throwable t) {
LOG.warn("Could not initiate the HiveServer2 Metrics system. Metrics may not be reported.", t);
}
public void addGauge(String name, final MetricsVariable variable) {
Gauge gauge = new Gauge() {
@Override
public Object getValue() {
return variable.getValue();
}
};
try {
gaugesLock.lock();
gauges.put(name, gauge);
// Metrics throws an Exception if we don't do this when the key already exists
if (metricRegistry.getGauges().containsKey(name)) {
LOGGER.warn("A Gauge with name [" + name + "] already exists. "
+ " The old gauge will be overwritten, but this is not recommended");
metricRegistry.remove(name);
}
metricRegistry.register(name, gauge);
} finally {
gaugesLock.unlock();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
(6)initReporting