You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by andrewor14 <gi...@git.apache.org> on 2015/11/09 21:02:49 UTC
[GitHub] spark pull request: [SPARK-10930] History "Stages" page "duration"...
Github user andrewor14 commented on a diff in the pull request:
https://github.com/apache/spark/pull/9051#discussion_r44323340
--- Diff: core/src/main/scala/org/apache/spark/ui/jobs/StageTable.scala ---
@@ -145,9 +145,20 @@ private[ui] class StageTableBase(
case None => "Unknown"
}
val finishTime = s.completionTime.getOrElse(System.currentTimeMillis)
- val duration = s.submissionTime.map { t =>
- if (finishTime > t) finishTime - t else System.currentTimeMillis - t
- }
+ val taskLaunchTimes = stageData.taskData.values
+ .filter(_.taskInfo.launchTime != 0)
+ .map(_.taskInfo.launchTime)
+ val duration : Option[Long] =
+ if (taskLaunchTimes.nonEmpty) {
+ val startTime = taskLaunchTimes.min
+ if (finishTime > startTime) {
+ Option[Long](finishTime - startTime)
+ } else {
+ Option[Long](System.currentTimeMillis() - startTime)
--- End diff --
these are always defined, so you can just do `Some(...)`
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org