diff options
author | Davies Liu <davies@databricks.com> | 2016-04-12 15:03:00 -0700 |
---|---|---|
committer | Davies Liu <davies.liu@gmail.com> | 2016-04-12 15:03:00 -0700 |
commit | 1ef5f8cfa6d6b7c9ec58a96dc447ab56ef709381 (patch) | |
tree | 92e8ffb32966c7a56bd4bd9225324df33a0ed26f /sql | |
parent | 3e53de4bdd6d7b6de1fe3e5bfbdc53180aa9a737 (diff) | |
download | spark-1ef5f8cfa6d6b7c9ec58a96dc447ab56ef709381.tar.gz spark-1ef5f8cfa6d6b7c9ec58a96dc447ab56ef709381.tar.bz2 spark-1ef5f8cfa6d6b7c9ec58a96dc447ab56ef709381.zip |
[SPARK-14544] [SQL] improve performance of SQL UI tab
## What changes were proposed in this pull request?
This PR improve the performance of SQL UI by:
1) remove the details column in all executions page (the first page in SQL tab). We can check the details by enter the execution page.
2) break-all is super slow in Chrome recently, so switch to break-word.
3) Using "display: none" to hide a block.
4) using one js closure for for all the executions, not one for each.
5) remove the height limitation of details, don't need to scroll it in the tiny window.
## How was this patch tested?
Exists tests.
![ui](https://cloud.githubusercontent.com/assets/40902/14445712/68d7b258-0004-11e6-9b48-5d329b05d165.png)
Author: Davies Liu <davies@databricks.com>
Closes #12311 from davies/ui_perf.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/core/src/main/scala/org/apache/spark/sql/execution/ui/AllExecutionsPage.scala | 40 |
1 files changed, 10 insertions, 30 deletions
diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/ui/AllExecutionsPage.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/ui/AllExecutionsPage.scala index d3e823fdeb..e96fb9f755 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/execution/ui/AllExecutionsPage.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/ui/AllExecutionsPage.scala @@ -55,6 +55,12 @@ private[ui] class AllExecutionsPage(parent: SQLTab) extends WebUIPage("") with L } _content } + content ++= + <script> + function clickDetail(details) {{ + details.parentNode.querySelector('.stage-details').classList.toggle('collapsed') + }} + </script> UIUtils.headerSparkPage("SQL", content, parent, Some(5000)) } } @@ -118,14 +124,12 @@ private[ui] abstract class ExecutionTable( {failedJobs} </td> }} - {detailCell(executionUIData.physicalPlanDescription)} </tr> } private def descriptionCell(execution: SQLExecutionUIData): Seq[Node] = { val details = if (execution.details.nonEmpty) { - <span onclick="this.parentNode.querySelector('.stage-details').classList.toggle('collapsed')" - class="expand-details"> + <span onclick="clickDetail(this)" class="expand-details"> +details </span> ++ <div class="stage-details collapsed"> @@ -142,30 +146,6 @@ private[ui] abstract class ExecutionTable( <div>{desc} {details}</div> } - private def detailCell(physicalPlan: String): Seq[Node] = { - val isMultiline = physicalPlan.indexOf('\n') >= 0 - val summary = StringEscapeUtils.escapeHtml4( - if (isMultiline) { - physicalPlan.substring(0, physicalPlan.indexOf('\n')) - } else { - physicalPlan - }) - val details = if (isMultiline) { - // scalastyle:off - <span onclick="this.parentNode.querySelector('.stacktrace-details').classList.toggle('collapsed')" - class="expand-details"> - +details - </span> ++ - <div class="stacktrace-details collapsed"> - <pre>{physicalPlan}</pre> - </div> - // scalastyle:on - } else { - "" - } - <td>{summary}{details}</td> - } - def toNodeSeq: Seq[Node] = { <div> <h4>{tableName}</h4> @@ -197,7 +177,7 @@ private[ui] class RunningExecutionTable( showFailedJobs = true) { override protected def header: Seq[String] = - baseHeader ++ Seq("Running Jobs", "Succeeded Jobs", "Failed Jobs", "Detail") + baseHeader ++ Seq("Running Jobs", "Succeeded Jobs", "Failed Jobs") } private[ui] class CompletedExecutionTable( @@ -215,7 +195,7 @@ private[ui] class CompletedExecutionTable( showSucceededJobs = true, showFailedJobs = false) { - override protected def header: Seq[String] = baseHeader ++ Seq("Jobs", "Detail") + override protected def header: Seq[String] = baseHeader ++ Seq("Jobs") } private[ui] class FailedExecutionTable( @@ -234,5 +214,5 @@ private[ui] class FailedExecutionTable( showFailedJobs = true) { override protected def header: Seq[String] = - baseHeader ++ Seq("Succeeded Jobs", "Failed Jobs", "Detail") + baseHeader ++ Seq("Succeeded Jobs", "Failed Jobs") } |