You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ap...@apache.org on 2016/04/21 19:30:05 UTC
[3/3] hbase git commit: Amend HBASE-15663 Hook up JvmPauseMonitor to
ThriftServer
Amend HBASE-15663 Hook up JvmPauseMonitor to ThriftServer
Somehow missed the Hadoop 1 metrics changes in previous commit
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/9bc00b8d
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/9bc00b8d
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/9bc00b8d
Branch: refs/heads/0.98
Commit: 9bc00b8d19f7d31486615fca1ad19bf2c6a1b338
Parents: 3acf3f8
Author: Andrew Purtell <ap...@apache.org>
Authored: Thu Apr 21 10:26:04 2016 -0700
Committer: Andrew Purtell <ap...@apache.org>
Committed: Thu Apr 21 10:28:23 2016 -0700
----------------------------------------------------------------------
.../thrift/MetricsThriftServerSourceImpl.java | 34 ++++++++++++++++++++
1 file changed, 34 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/9bc00b8d/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/hbase/thrift/MetricsThriftServerSourceImpl.java
----------------------------------------------------------------------
diff --git a/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/hbase/thrift/MetricsThriftServerSourceImpl.java b/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/hbase/thrift/MetricsThriftServerSourceImpl.java
index f3d96a5..a208639 100644
--- a/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/hbase/thrift/MetricsThriftServerSourceImpl.java
+++ b/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/hbase/thrift/MetricsThriftServerSourceImpl.java
@@ -19,6 +19,7 @@
package org.apache.hadoop.hbase.thrift;
import org.apache.hadoop.hbase.metrics.BaseSourceImpl;
+import org.apache.hadoop.metrics2.lib.MetricMutableCounterLong;
import org.apache.hadoop.metrics2.lib.MetricMutableGaugeLong;
import org.apache.hadoop.metrics2.lib.MetricMutableHistogram;
import org.apache.hadoop.metrics2.lib.MetricMutableStat;
@@ -41,11 +42,25 @@ public class MetricsThriftServerSourceImpl extends BaseSourceImpl implements
private MetricMutableGaugeLong callQueueLenGauge;
+ // pause monitor metrics
+ private final MetricMutableCounterLong infoPauseThresholdExceeded;
+ private final MetricMutableCounterLong warnPauseThresholdExceeded;
+ private final MetricMutableHistogram pausesWithGc;
+ private final MetricMutableHistogram pausesWithoutGc;
+
public MetricsThriftServerSourceImpl(String metricsName,
String metricsDescription,
String metricsContext,
String metricsJmxContext) {
super(metricsName, metricsDescription, metricsContext, metricsJmxContext);
+
+ // pause monitor metrics
+ infoPauseThresholdExceeded = getMetricsRegistry().newCounter(INFO_THRESHOLD_COUNT_KEY,
+ INFO_THRESHOLD_COUNT_DESC, 0L);
+ warnPauseThresholdExceeded = getMetricsRegistry().newCounter(WARN_THRESHOLD_COUNT_KEY,
+ WARN_THRESHOLD_COUNT_DESC, 0L);
+ pausesWithGc = getMetricsRegistry().newTimeHistogram(PAUSE_TIME_WITH_GC_KEY);
+ pausesWithoutGc = getMetricsRegistry().newTimeHistogram(PAUSE_TIME_WITHOUT_GC_KEY);
}
@@ -96,4 +111,23 @@ public class MetricsThriftServerSourceImpl extends BaseSourceImpl implements
thriftSlowCallStat.add(time);
}
+ @Override
+ public void incInfoThresholdExceeded(int count) {
+ infoPauseThresholdExceeded.incr(count);
+ }
+
+ @Override
+ public void incWarnThresholdExceeded(int count) {
+ warnPauseThresholdExceeded.incr(count);
+ }
+
+ @Override
+ public void updatePauseTimeWithGc(long t) {
+ pausesWithGc.add(t);
+ }
+
+ @Override
+ public void updatePauseTimeWithoutGc(long t) {
+ pausesWithoutGc.add(t);
+ }
}