kiszk commented on a change in pull request #22874: [SPARK-25865][CORE] Add GC 
information to ExecutorMetrics
URL: https://github.com/apache/spark/pull/22874#discussion_r257536961
 
 

 ##########
 File path: 
core/src/main/scala/org/apache/spark/metrics/ExecutorMetricType.scala
 ##########
 @@ -135,19 +135,17 @@ 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
-    if (SparkEnv.get.conf.get(config.EVENT_LOG_GC_METRICS)) {
       ManagementFactory.getGarbageCollectorMXBeans.asScala.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 {
-          logDebug(s"${mxBean.getName} is an unsupported garbage collector." +
-            s"Add it to 
${config.EVENT_LOG_GC_METRICS_YOUNG_GENERATION_GARBAGE_COLLECTORS} " +
-            s"or 
${config.EVENT_LOG_GC_METRICS_OLD_GENERATION_GARBAGE_COLLECTORS} to enable.")
-        }
+      if (youngGenerationGarbageCollector.contains(mxBean.getName)) {
+        gcMetrics(0) = mxBean.getCollectionCount
 
 Review comment:
   Sorry for being late. I agree with one collector per generation.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to