Skip to content

Commit

Permalink
Ensure scheduler delay handles unfinished task case, and ensure delay…
Browse files Browse the repository at this point in the history
… is never negative even due to rounding
  • Loading branch information
srowen committed Feb 26, 2015
1 parent b38dec2 commit ad6713c
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

0 comments on commit ad6713c

Please sign in to comment.