瀏覽代碼

HADOOP-19371. JVM GC Metrics supports ZGC pause time and count (#7230) Contributed by cxzl25.

Reviewed-by: Tao Li <tomscut@apache.org>
Reviewed-by: Cheng Pan <chengpan@apache.org>
Signed-off-by: Shilun Fan <slfan1989@apache.org>
cxzl25 4 月之前
父節點
當前提交
ecc4e00145

+ 7 - 0
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/source/JvmMetrics.java

@@ -181,6 +181,13 @@ public class JvmMetrics implements MetricsSource {
     long count = 0;
     long timeMillis = 0;
     for (GarbageCollectorMXBean gcBean : gcBeans) {
+      if (gcBean.getName() != null) {
+        String name = gcBean.getName();
+        // JDK-8265136 Skip concurrent phase
+        if (name.startsWith("ZGC") && name.endsWith("Cycles")) {
+          continue;
+        }
+      }
       long c = gcBean.getCollectionCount();
       long t = gcBean.getCollectionTime();
       MetricsInfo[] gcInfo = getGcInfo(gcBean.getName());