Skip to content
Snippets Groups Projects
Commit 1422e79e authored by zsxwing's avatar zsxwing Committed by Tathagata Das
Browse files

[SPARK-7406] [STREAMING] [WEBUI] Add tooltips for "Scheduling Delay",...

[SPARK-7406] [STREAMING] [WEBUI] Add tooltips for "Scheduling Delay", "Processing Time" and "Total Delay"

Screenshots:
![screen shot 2015-05-06 at 2 29 03 pm](https://cloud.githubusercontent.com/assets/1000778/7504129/9c57f710-f3fc-11e4-9c6e-1b79c17c546d.png)

![screen shot 2015-05-06 at 2 24 35 pm](https://cloud.githubusercontent.com/assets/1000778/7504140/b63bb216-f3fc-11e4-83a5-6dfc6481d192.png)

tdas as we discussed offline

Author: zsxwing <zsxwing@gmail.com>

Closes #5952 from zsxwing/SPARK-7406 and squashes the following commits:

2b004ea [zsxwing] Merge branch 'master' into SPARK-7406
e9eb506 [zsxwing] Update tooltip contents
2215b2a [zsxwing] Add tooltips for "Scheduling Delay", "Processing Time" and "Total Delay"
parent a4874b0d
No related branches found
No related tags found
No related merge requests found
...@@ -194,11 +194,7 @@ private[spark] object UIUtils extends Logging { ...@@ -194,11 +194,7 @@ private[spark] object UIUtils extends Logging {
<a href={prependBaseUri(activeTab.basePath, "/" + tab.prefix + "/")}>{tab.name}</a> <a href={prependBaseUri(activeTab.basePath, "/" + tab.prefix + "/")}>{tab.name}</a>
</li> </li>
} }
val helpButton: Seq[Node] = helpText.map { helpText => val helpButton: Seq[Node] = helpText.map(tooltip(_, "bottom")).getOrElse(Seq.empty)
<sup>
(<a data-toggle="tooltip" data-placement="bottom" title={helpText}>?</a>)
</sup>
}.getOrElse(Seq.empty)
<html> <html>
<head> <head>
...@@ -375,6 +371,12 @@ private[spark] object UIUtils extends Logging { ...@@ -375,6 +371,12 @@ private[spark] object UIUtils extends Logging {
</div> </div>
} }
def tooltip(text: String, position: String): Seq[Node] = {
<sup>
(<a data-toggle="tooltip" data-placement={position} title={text}>?</a>)
</sup>
}
/** Return a script element that automatically expands the DAG visualization on page load. */ /** Return a script element that automatically expands the DAG visualization on page load. */
def expandDagVizOnLoad(forJob: Boolean): Seq[Node] = { def expandDagVizOnLoad(forJob: Boolean): Seq[Node] = {
<script type="text/javascript"> <script type="text/javascript">
......
...@@ -26,8 +26,11 @@ private[ui] abstract class BatchTableBase(tableId: String) { ...@@ -26,8 +26,11 @@ private[ui] abstract class BatchTableBase(tableId: String) {
protected def columns: Seq[Node] = { protected def columns: Seq[Node] = {
<th>Batch Time</th> <th>Batch Time</th>
<th>Input Size</th> <th>Input Size</th>
<th>Scheduling Delay</th> <th>Scheduling Delay
<th>Processing Time</th> {SparkUIUtils.tooltip("Time taken by Streaming scheduler to submit jobs of a batch", "top")}
</th>
<th>Processing Time
{SparkUIUtils.tooltip("Time taken to process all jobs of a batch", "top")}</th>
} }
protected def baseRow(batch: BatchUIData): Seq[Node] = { protected def baseRow(batch: BatchUIData): Seq[Node] = {
...@@ -99,7 +102,9 @@ private[ui] class ActiveBatchTable( ...@@ -99,7 +102,9 @@ private[ui] class ActiveBatchTable(
private[ui] class CompletedBatchTable(batches: Seq[BatchUIData]) private[ui] class CompletedBatchTable(batches: Seq[BatchUIData])
extends BatchTableBase("completed-batches-table") { extends BatchTableBase("completed-batches-table") {
override protected def columns: Seq[Node] = super.columns ++ <th>Total Delay</th> override protected def columns: Seq[Node] = super.columns ++
<th>Total Delay
{SparkUIUtils.tooltip("Total time taken to handle a batch", "top")}</th>
override protected def renderRows: Seq[Node] = { override protected def renderRows: Seq[Node] = {
batches.flatMap(batch => <tr>{completedBatchRow(batch)}</tr>) batches.flatMap(batch => <tr>{completedBatchRow(batch)}</tr>)
......
...@@ -347,7 +347,7 @@ private[ui] class StreamingPage(parent: StreamingTab) ...@@ -347,7 +347,7 @@ private[ui] class StreamingPage(parent: StreamingTab)
<tr> <tr>
<td style="vertical-align: middle;"> <td style="vertical-align: middle;">
<div style="width: 160px;"> <div style="width: 160px;">
<div><strong>Scheduling Delay</strong></div> <div><strong>Scheduling Delay {SparkUIUtils.tooltip("Time taken by Streaming scheduler to submit jobs of a batch", "right")}</strong></div>
<div>Avg: {schedulingDelay.formattedAvg}</div> <div>Avg: {schedulingDelay.formattedAvg}</div>
</div> </div>
</td> </td>
...@@ -357,7 +357,7 @@ private[ui] class StreamingPage(parent: StreamingTab) ...@@ -357,7 +357,7 @@ private[ui] class StreamingPage(parent: StreamingTab)
<tr> <tr>
<td style="vertical-align: middle;"> <td style="vertical-align: middle;">
<div style="width: 160px;"> <div style="width: 160px;">
<div><strong>Processing Time</strong></div> <div><strong>Processing Time {SparkUIUtils.tooltip("Time taken to process all jobs of a batch", "right")}</strong></div>
<div>Avg: {processingTime.formattedAvg}</div> <div>Avg: {processingTime.formattedAvg}</div>
</div> </div>
</td> </td>
...@@ -367,7 +367,7 @@ private[ui] class StreamingPage(parent: StreamingTab) ...@@ -367,7 +367,7 @@ private[ui] class StreamingPage(parent: StreamingTab)
<tr> <tr>
<td style="vertical-align: middle;"> <td style="vertical-align: middle;">
<div style="width: 160px;"> <div style="width: 160px;">
<div><strong>Total Delay</strong></div> <div><strong>Total Delay {SparkUIUtils.tooltip("Total time taken to handle a batch", "right")}</strong></div>
<div>Avg: {totalDelay.formattedAvg}</div> <div>Avg: {totalDelay.formattedAvg}</div>
</div> </div>
</td> </td>
......
...@@ -116,12 +116,12 @@ class UISeleniumSuite ...@@ -116,12 +116,12 @@ class UISeleniumSuite
h4Text.exists(_.matches("Completed Batches \\(last \\d+ out of \\d+\\)")) should be (true) h4Text.exists(_.matches("Completed Batches \\(last \\d+ out of \\d+\\)")) should be (true)
findAll(cssSelector("""#active-batches-table th""")).map(_.text).toSeq should be { findAll(cssSelector("""#active-batches-table th""")).map(_.text).toSeq should be {
List("Batch Time", "Input Size", "Scheduling Delay", "Processing Time", List("Batch Time", "Input Size", "Scheduling Delay (?)", "Processing Time (?)",
"Status") "Status")
} }
findAll(cssSelector("""#completed-batches-table th""")).map(_.text).toSeq should be { findAll(cssSelector("""#completed-batches-table th""")).map(_.text).toSeq should be {
List("Batch Time", "Input Size", "Scheduling Delay", "Processing Time", List("Batch Time", "Input Size", "Scheduling Delay (?)", "Processing Time (?)",
"Total Delay") "Total Delay (?)")
} }
val batchLinks = val batchLinks =
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment