diff --git a/core/src/main/scala/org/apache/spark/scheduler/SparkListener.scala b/core/src/main/scala/org/apache/spark/scheduler/SparkListener.scala index 3becb4f068cfdd5abb74ff862063ba8cf9e2d3aa..627995c826e2b844cdc6a9656ee2d45c51a204df 100644 --- a/core/src/main/scala/org/apache/spark/scheduler/SparkListener.scala +++ b/core/src/main/scala/org/apache/spark/scheduler/SparkListener.scala @@ -119,8 +119,7 @@ object StatsReportListener extends Logging { val probabilities = percentiles.map{_ / 100.0} val percentilesHeader = "\t" + percentiles.mkString("%\t") + "%" - def extractDoubleDistribution( - stage:SparkListenerStageCompleted, + def extractDoubleDistribution(stage: SparkListenerStageCompleted, getMetric: (TaskInfo,TaskMetrics) => Option[Double]) : Option[Distribution] = { Distribution(stage.stage.taskInfos.flatMap { @@ -128,8 +127,7 @@ object StatsReportListener extends Logging { } //is there some way to setup the types that I can get rid of this completely? - def extractLongDistribution( - stage:SparkListenerStageCompleted, + def extractLongDistribution(stage: SparkListenerStageCompleted, getMetric: (TaskInfo,TaskMetrics) => Option[Long]) : Option[Distribution] = { extractDoubleDistribution(stage, (info, metric) => getMetric(info,metric).map{_.toDouble})