Github user rezasafi commented on a diff in the pull request: https://github.com/apache/spark/pull/22612#discussion_r230852432 --- Diff: core/src/main/scala/org/apache/spark/util/JsonProtocol.scala --- @@ -394,9 +394,15 @@ private[spark] object JsonProtocol { /** Convert executor metrics to JSON. */ def executorMetricsToJson(executorMetrics: ExecutorMetrics): JValue = { - val metrics = ExecutorMetricType.values.map{ metricType => - JField(metricType.name, executorMetrics.getMetricValue(metricType)) - } + val metrics = for { + (m, _) <- ExecutorMetricType.definedMetricsAndOffset.toSeq + } yield { + JField(m, executorMetrics.getMetricValue(m)) + } + + // ExecutorMetricType.definedMetricsAndOffset.foreach { case (m,offset) => --- End diff -- Sorry about these comments. will remove them soon in the next batch
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org