From ed55dabd699b1c77df09d1c43f898a4b41d18e81 Mon Sep 17 00:00:00 2001 From: sychen Date: Tue, 17 Dec 2024 12:25:37 +0800 Subject: [PATCH 1/2] ZGC --- .../java/org/apache/hadoop/metrics2/source/JvmMetrics.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/source/JvmMetrics.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/source/JvmMetrics.java index 19429979a0236..f9cc23b1b0d6e 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/source/JvmMetrics.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/source/JvmMetrics.java @@ -181,6 +181,13 @@ private void getGcUsage(MetricsRecordBuilder rb) { 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()); From 35ca5d721cd145a5b10362a271bbad352472d02c Mon Sep 17 00:00:00 2001 From: sychen Date: Tue, 17 Dec 2024 16:12:51 +0800 Subject: [PATCH 2/2] address --- .../main/java/org/apache/hadoop/metrics2/source/JvmMetrics.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/source/JvmMetrics.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/source/JvmMetrics.java index f9cc23b1b0d6e..89b7829cfb0e9 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/source/JvmMetrics.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/source/JvmMetrics.java @@ -184,7 +184,7 @@ private void getGcUsage(MetricsRecordBuilder rb) { if (gcBean.getName() != null) { String name = gcBean.getName(); // JDK-8265136 Skip concurrent phase - if ((name.startsWith("ZGC") && name.endsWith("Cycles"))) { + if (name.startsWith("ZGC") && name.endsWith("Cycles")) { continue; } }