Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/22381#discussion_r216392303
--- Diff:
core/src/main/scala/org/apache/spark/status/AppStatusListener.scala ---
@@ -382,11 +392,37 @@ private[spark] class AppStatusListener(
}
job.status = event.jobResult match {
- case JobSucceeded => JobExecutionStatus.SUCCEEDED
- case JobFailed(_) => JobExecutionStatus.FAILED
+ case JobSucceeded =>
+ appStatusSource.foreach{_.SUCCEEDED_JOBS.inc(1)}
+ JobExecutionStatus.SUCCEEDED
+ case JobFailed(_) =>
+ appStatusSource.foreach{_.FAILED_JOBS.inc(1)}
+ JobExecutionStatus.FAILED
}
job.completionTime = if (event.time > 0) Some(new Date(event.time))
else None
+
+ for {
+ submissionTime <- job.submissionTime
+ completionTime <- job.completionTime
+ } yield {
--- End diff --
Nit: don't you technically need `foreach` here? I think it might be clearer
to just wrap this in `if (job.submissionTime.isDefined && ...)` rather than the
`for yield` that doesn't really loop.
Below -- isn't this just trying to take the difference in time in
milliseconds between two dates? if so don't you just subtract their timestamps
or is it more subtle here?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]