Github user squito commented on a diff in the pull request: https://github.com/apache/spark/pull/22612#discussion_r234334582 --- Diff: core/src/main/scala/org/apache/spark/Heartbeater.scala --- @@ -60,11 +60,16 @@ private[spark] class Heartbeater( } /** - * Get the current executor level metrics. These are returned as an array, with the index - * determined by ExecutorMetricType.values + * Get the current executor level metrics. These are returned as an array */ def getCurrentMetrics(): ExecutorMetrics = { - val metrics = ExecutorMetricType.values.map(_.getMetricValue(memoryManager)).toArray + val metrics = new Array[Long](ExecutorMetricType.numMetrics) + var offset = 0 + ExecutorMetricType.metricGetters.foreach { metric => + val newSetOfMetrics = metric.getMetricValues(memoryManager) --- End diff -- nit: lets avoid "set", since order matters, you can just use `newMetrics`
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org