From ecc4e00145f1699d39b0856920a131cb47a8d0a4 Mon Sep 17 00:00:00 2001 From: cxzl25 <3898450+cxzl25@users.noreply.github.com> Date: Wed, 25 Dec 2024 16:48:05 +0800 Subject: [PATCH] HADOOP-19371. JVM GC Metrics supports ZGC pause time and count (#7230) Contributed by cxzl25. Reviewed-by: Tao Li Reviewed-by: Cheng Pan Signed-off-by: Shilun Fan --- .../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..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 @@ -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());