HADOOP-15067. GC time percentage reported in JvmMetrics should be a gauge, not counter. Contributed by Misha Dmitriev.

(cherry picked from commit d162252d7a)
This commit is contained in:
Xiao Chen 2017-11-23 09:00:59 -08:00
parent 5884b8a80a
commit 4f71c27f2e
2 changed files with 2 additions and 2 deletions

View File

@ -188,7 +188,7 @@ public class JvmMetrics implements MetricsSource {
}
if (gcTimeMonitor != null) {
rb.addCounter(GcTimePercentage,
rb.addGauge(GcTimePercentage,
gcTimeMonitor.getLatestGcData().getGcTimePercentage());
}
}

View File

@ -101,7 +101,7 @@ public class TestJvmMetrics {
verify(rb).tag(SessionId, "test");
for (JvmMetricsInfo info : JvmMetricsInfo.values()) {
if (info.name().equals("GcTimePercentage")) {
verify(rb).addCounter(eq(info), anyInt());
verify(rb).addGauge(eq(info), anyInt());
}
}
}