diff options
author | Sean Owen <sowen@cloudera.com> | 2015-02-26 17:35:09 -0800 |
---|---|---|
committer | Andrew Or <andrew@databricks.com> | 2015-02-26 17:35:09 -0800 |
commit | fbc469473dd529eb72046186b85dd8fc2b7c5bb5 (patch) | |
tree | ab575db20c42cee7016a7f2c0b188dbd6ca426cb | |
parent | e60ad2f4c47b011be7a3198689ac2b82ee317d96 (diff) | |
download | spark-fbc469473dd529eb72046186b85dd8fc2b7c5bb5.tar.gz spark-fbc469473dd529eb72046186b85dd8fc2b7c5bb5.tar.bz2 spark-fbc469473dd529eb72046186b85dd8fc2b7c5bb5.zip |
SPARK-4579 [WEBUI] Scheduling Delay appears negative
Ensure scheduler delay handles unfinished task case, and ensure delay is never negative even due to rounding
Author: Sean Owen <sowen@cloudera.com>
Closes #4796 from srowen/SPARK-4579 and squashes the following commits:
ad6713c [Sean Owen] Ensure scheduler delay handles unfinished task case, and ensure delay is never negative even due to rounding
-rw-r--r-- | core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala b/core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala index d752434ad5..110f8780a9 100644 --- a/core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala +++ b/core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala @@ -626,15 +626,16 @@ private[ui] class StagePage(parent: StagesTab) extends WebUIPage("stage") { } private def getSchedulerDelay(info: TaskInfo, metrics: TaskMetrics): Long = { - val totalExecutionTime = { - if (info.gettingResultTime > 0) { - (info.gettingResultTime - info.launchTime) + val totalExecutionTime = + if (info.gettingResult) { + info.gettingResultTime - info.launchTime + } else if (info.finished) { + info.finishTime - info.launchTime } else { - (info.finishTime - info.launchTime) + 0 } - } val executorOverhead = (metrics.executorDeserializeTime + metrics.resultSerializationTime) - totalExecutionTime - metrics.executorRunTime - executorOverhead + math.max(0, totalExecutionTime - metrics.executorRunTime - executorOverhead) } } |