You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/12/06 06:29:28 UTC

[GitHub] [spark] mridulm commented on a change in pull request #34749: [SPARK-37493][CORE] show driver's gc time and duration time in executors page

mridulm commented on a change in pull request #34749:
URL: https://github.com/apache/spark/pull/34749#discussion_r762722711



##########
File path: core/src/main/scala/org/apache/spark/metrics/ExecutorMetricType.scala
##########
@@ -137,7 +138,9 @@ case object GarbageCollectionMetrics extends ExecutorMetricType with Logging {
 
   override private[spark] def getMetricValues(memoryManager: MemoryManager): Array[Long] = {
     val gcMetrics = new Array[Long](names.length) // minorCount, minorTime, majorCount, majorTime
-    ManagementFactory.getGarbageCollectorMXBeans.asScala.foreach { mxBean =>
+    val mxBeans = ManagementFactory.getGarbageCollectorMXBeans.asScala
+    gcMetrics(4) = mxBeans.map(_.getCollectionTime).sum

Review comment:
       Why not simply rely on MinorGCTime + MajorGCTime instead ?
   Custom collectors are not handled in general currently in spark anyway - is there a reason to include them as well ?




-- 
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