You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by sr...@apache.org on 2018/12/28 13:42:26 UTC

[spark] branch branch-2.3 updated: [SPARK-26444][WEBUI] Stage color doesn't change with it's status

This is an automated email from the ASF dual-hosted git repository.

srowen pushed a commit to branch branch-2.3
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-2.3 by this push:
     new acbfb31  [SPARK-26444][WEBUI] Stage color doesn't change with it's status
acbfb31 is described below

commit acbfb31137aefff47ef8ddae36f1fd389d1d8ef1
Author: seancxmao <se...@gmail.com>
AuthorDate: Fri Dec 28 07:40:59 2018 -0600

    [SPARK-26444][WEBUI] Stage color doesn't change with it's status
    
    ## 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 <se...@gmail.com>
    Signed-off-by: Sean Owen <se...@databricks.com>
    (cherry picked from commit 5bef4fedfe1916320223b1245bacb58f151cee66)
    Signed-off-by: Sean Owen <se...@databricks.com>
---
 .../main/resources/org/apache/spark/ui/static/timeline-view.css   | 8 ++++----
 core/src/main/scala/org/apache/spark/ui/jobs/JobPage.scala        | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/core/src/main/resources/org/apache/spark/ui/static/timeline-view.css b/core/src/main/resources/org/apache/spark/ui/static/timeline-view.css
index 3bf3e8b..10bceae 100644
--- a/core/src/main/resources/org/apache/spark/ui/static/timeline-view.css
+++ b/core/src/main/resources/org/apache/spark/ui/static/timeline-view.css
@@ -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;
@@ -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;
diff --git a/core/src/main/scala/org/apache/spark/ui/jobs/JobPage.scala b/core/src/main/scala/org/apache/spark/ui/jobs/JobPage.scala
index 974e5c5..4cd2c7a 100644
--- a/core/src/main/scala/org/apache/spark/ui/jobs/JobPage.scala
+++ b/core/src/main/scala/org/apache/spark/ui/jobs/JobPage.scala
@@ -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())


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org