Skip to content

Commit

Permalink
Various small tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
mateiz committed May 8, 2015
1 parent cd1d411 commit 67629f5
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 81 deletions.
104 changes: 57 additions & 47 deletions core/src/main/resources/org/apache/spark/ui/static/timeline-view.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ div#application-timeline, div#job-timeline {
margin-top: 5px;
}

.vis.timeline {
line-height: 14px;
}

.vis.timeline div.content {
width: 100%;
}
Expand All @@ -32,125 +36,131 @@ div#application-timeline, div#job-timeline {
}

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

.vis.timeline .item.stage.succeeded.selected {
background-color: #D5DDF6;
border-color: #97B0F8;
z-index: auto;
background-color: #A0DFFF;
border-color: #3EC0FF;
z-index: auto;
}

.legend-area rect.completed-stage-legend {
fill: #D5DDF6;
stroke: #97B0F8;
fill: #A0DFFF;
stroke: #3EC0FF;
}

.vis.timeline .item.stage.failed {
background-color: #FF5475;
background-color: #ffa1b0;
border-color: #ff4d6d;
}

.vis.timeline .item.stage.failed.selected {
background-color: #FF5475;
border-color: #97B0F8;
z-index: auto;
background-color: #ffa1b0;
border-color: #ff4d6d;
z-index: auto;
}

.legend-area rect.failed-stage-legend {
fill: #FF5475;
stroke: #97B0F8;
fill: #ffa1b0;
stroke: #ff4d6d;
}

.vis.timeline .item.stage.running {
background-color: #FDFFCA;
background-color: #a3ffc2;
border-color: #36f572;
}

.vis.timeline .item.stage.running.selected {
background-color: #FDFFCA;
border-color: #97B0F8;
z-index: auto;
background-color: #a3ffc2;
border-color: #36f572;
z-index: auto;
}

.legend-area rect.active-stage-legend {
fill: #FDFFCA;
stroke: #97B0F8;
fill: #a3ffc2;
stroke: #36f572;
}

.vis.timeline .item.job {
cursor: pointer;
}

.vis.timeline .item.job.succeeded {
background-color: #D5DDF6;
background-color: #A0DFFF;
}

.vis.timeline .item.job.succeeded.selected {
background-color: #D5DDF6;
border-color: #97B0F8;
z-index: auto;
background-color: #A0DFFF;
border-color: #3EC0FF;
z-index: auto;
}

.legend-area rect.succeeded-job-legend {
fill: #D5DDF6;
stroke: #97B0F8;
fill: #A0DFFF;
stroke: #3EC0FF;
}

.vis.timeline .item.job.failed {
background-color: #FF5475;
background-color: #ffa1b0;
border-color: #ff4d6d;
}

.vis.timeline .item.job.failed.selected {
background-color: #FF5475;
border-color: #97B0F8;
z-index: auto;
background-color: #ffa1b0;
border-color: #ff4d6d;
z-index: auto;
}

.legend-area rect.failed-job-legend {
fill: #FF5475;
stroke: #97B0F8;
fill: #ffa1b0;
stroke: #ff4d6d;
}

.vis.timeline .item.job.running {
background-color: #FDFFCA;
background-color: #a3ffc2;
border-color: #36f572;
}

.vis.timeline .item.job.running.selected {
background-color: #FDFFCA;
border-color: #97B0F8;
z-index: auto;
background-color: #a3ffc2;
border-color: #36f572;
z-index: auto;
}

.legend-area rect.running-job-legend {
fill: #FDFFCA;
stroke: #97B0F8;
fill: #a3ffc2;
stroke: #36f572;
}

.vis.timeline .item.executor.added {
background-color: #D5DDF6;
background-color: #A0DFFF;
}

.legend-area rect.executor-added-legend {
fill: #D5DDF6;
stroke: #97B0F8;
fill: #A0DFFF;
stroke: #3EC0FF;
}

.vis.timeline .item.executor.removed {
background-color: #EBCA59;
background-color: #ffa1b0;
border-color: #ff4d6d;
}

.legend-area rect.executor-removed-legend {
fill: #EBCA59;
stroke: #97B0F8;
fill: #ffa1b0;
stroke: #ff4d6d;
}

.vis.timeline .item.executor.selected {
border-color: #FFC200;
background-color: #FFF785;
background-color: #a3ffc2;
border-color: #36f572;
z-index: 2;
}

tr.corresponding-item-hover>td, tr.corresponding-item-hover>th {
background-color: #FFE1FA !important;
tr.corresponding-item-hover > td, tr.corresponding-item-hover > th {
background-color: #d6ffe4 !important;
}

#application-timeline.collapsed {
Expand All @@ -169,7 +179,7 @@ span.expand-application-timeline, span.expand-job-timeline {
cursor: pointer;
}

.control-panel input+span {
.control-panel input + span {
cursor: pointer;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,9 @@ function setupExecutorEventAction() {
function setupZoomable(id, timeline) {
$(id + '>input[type="checkbox"]').click(function() {
if (this.checked) {
timeline.setOptions({zoomable: false});
} else {
timeline.setOptions({zoomable: true});
} else {
timeline.setOptions({zoomable: false});
}
});

Expand Down
4 changes: 2 additions & 2 deletions core/src/main/scala/org/apache/spark/ui/UIUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ private[spark] object UIUtils extends Logging {
<h3 style="vertical-align: middle; display: inline-block;">
<a style="text-decoration: none" href={prependBaseUri("/")}>
<img src={prependBaseUri("/static/spark-logo-77x50px-hd.png")} />
<span class="version"
<span class="version"
style="margin-right: 15px;">{org.apache.spark.SPARK_VERSION}</span>
</a>
{title}
Expand Down Expand Up @@ -350,7 +350,7 @@ private[spark] object UIUtils extends Logging {
<div>
<span class="expand-dag-viz" onclick={s"toggleDagViz($forJob);"}>
<span class="expand-dag-viz-arrow arrow-closed"></span>
<strong>DAG visualization</strong>
<strong>DAG Visualization</strong>
</span>
<div id="dag-viz-graph"></div>
<div id="dag-viz-metadata">
Expand Down
12 changes: 6 additions & 6 deletions core/src/main/scala/org/apache/spark/ui/jobs/AllJobsPage.scala
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ private[ui] class AllJobsPage(parent: JobsTab) extends WebUIPage("") {
| 'content': '<div class="application-timeline-content"' +
| 'data-html="true" data-placement="top" data-toggle="tooltip"' +
| 'data-title="${displayJobDescription} (Job ${jobId})<br>Status: ${status}<br>' +
| 'Submission Time: ${UIUtils.formatDate(new Date(submissionTime))}' +
| 'Submitted: ${UIUtils.formatDate(new Date(submissionTime))}' +
| '${
if (status != JobExecutionStatus.RUNNING) {
s"""<br>Completion Time: ${UIUtils.formatDate(new Date(completionTime))}"""
s"""<br>Completed: ${UIUtils.formatDate(new Date(completionTime))}"""
} else {
""
}
Expand Down Expand Up @@ -179,13 +179,13 @@ private[ui] class AllJobsPage(parent: JobsTab) extends WebUIPage("") {

<span class="expand-application-timeline">
<span class="expand-application-timeline-arrow arrow-closed"></span>
<strong>Event timeline</strong>
<strong>Event Timeline</strong>
</span> ++
<div id="application-timeline" class="collapsed">
<div class="control-panel">
<div id="application-timeline-zoom-lock">
<input type="checkbox" checked="checked"></input>
<span>Zoom Lock</span>
<input type="checkbox"></input>
<span>Enable zooming</span>
</div>
</div>
</div> ++
Expand Down Expand Up @@ -277,7 +277,7 @@ private[ui] class AllJobsPage(parent: JobsTab) extends WebUIPage("") {
{if (parent.sc.isDefined) {
// Total duration is not meaningful unless the UI is live
<li>
<strong>Total Duration: </strong>
<strong>Total Uptime: </strong>
{UIUtils.formatDuration(System.currentTimeMillis() - startTime)}
</li>
}}
Expand Down
15 changes: 1 addition & 14 deletions core/src/main/scala/org/apache/spark/ui/jobs/AllStagesPage.scala
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,6 @@ private[ui] class AllStagesPage(parent: StagesTab) extends WebUIPage("") {
val summary: NodeSeq =
<div>
<ul class="unstyled">
{
if (sc.isDefined) {
// Total duration is not meaningful unless the UI is live
<li>
<strong>Total Duration: </strong>
{UIUtils.formatDuration(now - sc.get.startTime)}
</li>
}
}
<li>
<strong>Scheduling Mode: </strong>
{listener.schedulingMode.map(_.toString).getOrElse("Unknown")}
</li>
{
if (shouldShowActiveStages) {
<li>
Expand Down Expand Up @@ -139,7 +126,7 @@ private[ui] class AllStagesPage(parent: StagesTab) extends WebUIPage("") {
content ++= <h4 id ="failed">Failed Stages ({numFailedStages})</h4> ++
failedStagesTable.toNodeSeq
}
UIUtils.headerSparkPage("Spark Stages (for all jobs)", content, parent)
UIUtils.headerSparkPage("Stages for All Jobs", content, parent)
}
}
}
6 changes: 3 additions & 3 deletions core/src/main/scala/org/apache/spark/ui/jobs/JobPage.scala
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,13 @@ private[ui] class JobPage(parent: JobsTab) extends WebUIPage("job") {

<span class="expand-job-timeline">
<span class="expand-job-timeline-arrow arrow-closed"></span>
<strong>Event timeline</strong>
<strong>Event Timeline</strong>
</span> ++
<div id="job-timeline" class="collapsed">
<div class="control-panel">
<div id="job-timeline-zoom-lock">
<input type="checkbox" checked="checked"></input>
<span>Zoom Lock</span>
<input type="checkbox"></input>
<span>Enable zooming</span>
</div>
</div>
</div> ++
Expand Down
14 changes: 7 additions & 7 deletions core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ private[ui] class StagePage(parent: StagesTab) extends WebUIPage("stage") {
<div>
<ul class="unstyled">
<li>
<strong>Total task time across all tasks: </strong>
<strong>Total Time Across All Tasks: </strong>
{UIUtils.formatDuration(stageData.executorRunTime)}
</li>
{if (stageData.hasInput) {
Expand All @@ -90,25 +90,25 @@ private[ui] class StagePage(parent: StagesTab) extends WebUIPage("stage") {
}}
{if (stageData.hasShuffleRead) {
<li>
<strong>Shuffle read: </strong>
<strong>Shuffle Read: </strong>
{s"${Utils.bytesToString(stageData.shuffleReadTotalBytes)} / " +
s"${stageData.shuffleReadRecords}"}
</li>
}}
{if (stageData.hasShuffleWrite) {
<li>
<strong>Shuffle write: </strong>
<strong>Shuffle Write: </strong>
{s"${Utils.bytesToString(stageData.shuffleWriteBytes)} / " +
s"${stageData.shuffleWriteRecords}"}
</li>
}}
{if (stageData.hasBytesSpilled) {
<li>
<strong>Shuffle spill (memory): </strong>
<strong>Shuffle Spill (Memory): </strong>
{Utils.bytesToString(stageData.memoryBytesSpilled)}
</li>
<li>
<strong>Shuffle spill (disk): </strong>
<strong>Shuffle Spill (Disk): </strong>
{Utils.bytesToString(stageData.diskBytesSpilled)}
</li>
}}
Expand All @@ -119,7 +119,7 @@ private[ui] class StagePage(parent: StagesTab) extends WebUIPage("stage") {
<div>
<span class="expand-additional-metrics">
<span class="expand-additional-metrics-arrow arrow-closed"></span>
<strong>Show additional metrics</strong>
<strong>Show Additional Metrics</strong>
</span>
<div class="additional-metrics collapsed">
<ul style="list-style-type:none">
Expand Down Expand Up @@ -449,9 +449,9 @@ private[ui] class StagePage(parent: StagesTab) extends WebUIPage("stage") {

val content =
summary ++
showAdditionalMetrics ++
dagViz ++
maybeExpandDagViz ++
showAdditionalMetrics ++
<h4>Summary Metrics for {numCompleted} Completed Tasks</h4> ++
<div>{summaryTable.getOrElse("No tasks have reported metrics yet.")}</div> ++
<h4>Aggregated Metrics by Executor</h4> ++ executorTable.toNodeSeq ++
Expand Down

0 comments on commit 67629f5

Please sign in to comment.