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:
parent
d7c9b58ec7
commit
b9239e0b79
|
@ -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