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

This commit is contained in:
Xiao Chen 2017-11-23 09:00:59 -08:00
parent b46ca7e73b
commit d162252d7a
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());
}
}
}