HADOOP-15067. GC time percentage reported in JvmMetrics should be a gauge, not counter. Contributed by Misha Dmitriev.
This commit is contained in:
parent
b46ca7e73b
commit
d162252d7a
|
@ -188,7 +188,7 @@ public class JvmMetrics implements MetricsSource {
|
|||
}
|
||||
|
||||
if (gcTimeMonitor != null) {
|
||||
rb.addCounter(GcTimePercentage,
|
||||
rb.addGauge(GcTimePercentage,
|
||||
gcTimeMonitor.getLatestGcData().getGcTimePercentage());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue