teeyog commented on a change in pull request #26241: [SPARK-29585][WEBUI] Fix 
stagePage duration
URL: https://github.com/apache/spark/pull/26241#discussion_r339864322
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/ui/jobs/StageTable.scala
 ##########
 @@ -417,19 +417,8 @@ private[ui] class StageDataSource(
       case Some(t) => UIUtils.formatDate(t)
       case None => "Unknown"
     }
-    val finishTime = 
stageData.completionTime.map(_.getTime()).getOrElse(currentTime)
-
-    // The submission time for a stage is misleading because it counts the time
-    // the stage waits to be launched. (SPARK-10930)
-    val duration = stageData.firstTaskLaunchedTime.map { date =>
-      val time = date.getTime()
-      if (finishTime > time) {
-        finishTime - time
-      } else {
-        None
-        currentTime - time
-      }
-    }
+
+    val duration = Some(stageData.executorRunTime)
 
 Review comment:
   > I think no. `stageData.executorRunTime` represents summation of 
`executorRunTime` of every task corresponding to the stage. Tasks need not be 
execute in sequential order (can be parallel also). So, I think this might not 
give the correct duration.
   > 
   > I think, field used to compute min/max stats, etc are 
`taskMetrics.executorRunTime`. @teeyog please correct me if I am wrong.
   
   What you said is correct. When the task is executed in parallel, the result 
is wrong. Then I think the task duration should not use executorRunTime. As 
shown in the previous figure, their values ​​are not match.
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to