You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "Hisoka-X (via GitHub)" <gi...@apache.org> on 2023/08/29 00:05:40 UTC

[GitHub] [spark] Hisoka-X commented on a diff in pull request #41808: [SPARK-44162][CORE] Support G1GC in spark metrics

Hisoka-X commented on code in PR #41808:
URL: https://github.com/apache/spark/pull/41808#discussion_r1308066899


##########
core/src/main/scala/org/apache/spark/metrics/ExecutorMetricType.scala:
##########
@@ -139,14 +143,17 @@ case object GarbageCollectionMetrics extends ExecutorMetricType with Logging {
   override private[spark] def getMetricValues(memoryManager: MemoryManager): Array[Long] = {
     val gcMetrics = new Array[Long](names.length)
     val mxBeans = ManagementFactory.getGarbageCollectorMXBeans.asScala
-    gcMetrics(4) = mxBeans.map(_.getCollectionTime).sum
+    gcMetrics(6) = mxBeans.map(_.getCollectionTime).sum
     mxBeans.foreach { mxBean =>
       if (youngGenerationGarbageCollector.contains(mxBean.getName)) {
         gcMetrics(0) = mxBean.getCollectionCount
         gcMetrics(1) = mxBean.getCollectionTime
       } else if (oldGenerationGarbageCollector.contains(mxBean.getName)) {
         gcMetrics(2) = mxBean.getCollectionCount
         gcMetrics(3) = mxBean.getCollectionTime
+      } else if (BUILTIN_CONCURRENT_GARBAGE_COLLECTOR.equals(mxBean.getName)) {
+        gcMetrics(4) = mxBean.getCollectionCount
+        gcMetrics(5) = mxBean.getCollectionTime

Review Comment:
   Oh, I missed it. Addressed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org