Skip to content

Commit

Permalink
[SPARK-26444][WEBUI] Stage color doesn't change with it's status
Browse files Browse the repository at this point in the history
## What changes were proposed in this pull request?
On job page, in event timeline section, stage color doesn't change according to its status. Below are some screenshots.

ACTIVE:
<img width="550" alt="active" src="https://user-images.githubusercontent.com/12194089/50438844-c763e580-092a-11e9-84f6-6fc30e08d69b.png">
COMPLETE:
<img width="516" alt="complete" src="https://user-images.githubusercontent.com/12194089/50438847-ca5ed600-092a-11e9-9d2e-5d79807bc1ce.png">
FAILED:
<img width="325" alt="failed" src="https://user-images.githubusercontent.com/12194089/50438852-ccc13000-092a-11e9-9b6b-782b96b283b1.png">

This PR lets stage color change with it's status. The main idea is to make css style class name match the corresponding stage status.

## How was this patch tested?
Manually tested locally.

```
// active/complete stage
sc.parallelize(1 to 3, 3).map { n => Thread.sleep(10* 1000); n }.count
// failed stage
sc.parallelize(1 to 3, 3).map { n => Thread.sleep(10* 1000); throw new Exception() }.count
```

Note we need to clear browser cache to let new `timeline-view.css` take effect. Below are screenshots after this PR.

ACTIVE:
<img width="569" alt="active-after" src="https://user-images.githubusercontent.com/12194089/50439986-08f68f80-092f-11e9-85d9-be1c31aed13b.png">
COMPLETE:
<img width="567" alt="complete-after" src="https://user-images.githubusercontent.com/12194089/50439990-0bf18000-092f-11e9-8624-723958906e90.png">
FAILED:
<img width="352" alt="failed-after" src="https://user-images.githubusercontent.com/12194089/50439993-101d9d80-092f-11e9-8dfd-3e20536f2fa5.png">

Closes #23385 from seancxmao/timeline-stage-color.

Authored-by: seancxmao <seancxmao@gmail.com>
Signed-off-by: Sean Owen <sean.owen@databricks.com>
  • Loading branch information
seancxmao authored and srowen committed Dec 28, 2018
1 parent f2adb61 commit 5bef4fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ rect.getting-result-time-proportion {
cursor: pointer;
}

.vis-timeline .vis-item.stage.succeeded {
.vis-timeline .vis-item.stage.complete {
background-color: #A0DFFF;
border-color: #3EC0FF;
}

.vis-timeline .vis-item.stage.succeeded.vis-selected {
.vis-timeline .vis-item.stage.complete.vis-selected {
background-color: #A0DFFF;
border-color: #3EC0FF;
z-index: auto;
Expand All @@ -130,12 +130,12 @@ rect.getting-result-time-proportion {
stroke: #FF4D6D;
}

.vis-timeline .vis-item.stage.running {
.vis-timeline .vis-item.stage.active {
background-color: #A2FCC0;
border-color: #36F572;
}

.vis-timeline .vis-item.stage.running.vis-selected {
.vis-timeline .vis-item.stage.active.vis-selected {
background-color: #A2FCC0;
border-color: #36F572;
z-index: auto;
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/org/apache/spark/ui/jobs/JobPage.scala
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private[ui] class JobPage(parent: JobsTab, store: AppStatusStore) extends WebUIP
val stageId = stage.stageId
val attemptId = stage.attemptId
val name = stage.name
val status = stage.status.toString
val status = stage.status.toString.toLowerCase(Locale.ROOT)
val submissionTime = stage.submissionTime.get.getTime()
val completionTime = stage.completionTime.map(_.getTime())
.getOrElse(System.currentTimeMillis())
Expand Down

0 comments on commit 5bef4fe

Please sign in to comment.