aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/resources
diff options
context:
space:
mode:
authorAlex Bozarth <ajbozart@us.ibm.com>2016-06-25 09:27:22 +0100
committerSean Owen <sowen@cloudera.com>2016-06-25 09:27:22 +0100
commit3ee9695d1fcf3750cbf7896a56f8a1ba93f4e82f (patch)
treedd5a086dae0de4f6b0107d067f257485257243cd /core/src/main/resources
parentbf665a958631125a1670504ef5966ef1a0e14798 (diff)
downloadspark-3ee9695d1fcf3750cbf7896a56f8a1ba93f4e82f.tar.gz
spark-3ee9695d1fcf3750cbf7896a56f8a1ba93f4e82f.tar.bz2
spark-3ee9695d1fcf3750cbf7896a56f8a1ba93f4e82f.zip
[SPARK-1301][WEB UI] Added anchor links to Accumulators and Tasks on StagePage
## What changes were proposed in this pull request? Sometimes the "Aggregated Metrics by Executor" table on the Stage page can get very long so actor links to the Accumulators and Tasks tables below it have been added to the summary at the top of the page. This has been done in the same way as the Jobs and Stages pages. Note: the Accumulators link only displays when the table exists. ## How was this patch tested? Manually Tested and dev/run-tests ![justtasks](https://cloud.githubusercontent.com/assets/13952758/15165269/6e8efe8c-16c9-11e6-9784-cffe966fdcf0.png) ![withaccumulators](https://cloud.githubusercontent.com/assets/13952758/15165270/7019ec9e-16c9-11e6-8649-db69ed7a317d.png) Author: Alex Bozarth <ajbozart@us.ibm.com> Closes #13037 from ajbozarth/spark1301.
Diffstat (limited to 'core/src/main/resources')
-rw-r--r--core/src/main/resources/org/apache/spark/ui/static/webui.css4
-rw-r--r--core/src/main/resources/org/apache/spark/ui/static/webui.js47
2 files changed, 49 insertions, 2 deletions
diff --git a/core/src/main/resources/org/apache/spark/ui/static/webui.css b/core/src/main/resources/org/apache/spark/ui/static/webui.css
index 595e80ab5e..b157f3e0a4 100644
--- a/core/src/main/resources/org/apache/spark/ui/static/webui.css
+++ b/core/src/main/resources/org/apache/spark/ui/static/webui.css
@@ -155,7 +155,7 @@ pre {
display: none;
}
-span.expand-additional-metrics, span.expand-dag-viz {
+span.expand-additional-metrics, span.expand-dag-viz, span.collapse-table {
cursor: pointer;
}
@@ -163,7 +163,7 @@ span.additional-metric-title {
cursor: pointer;
}
-.additional-metrics.collapsed {
+.additional-metrics.collapsed, .collapsible-table.collapsed {
display: none;
}
diff --git a/core/src/main/resources/org/apache/spark/ui/static/webui.js b/core/src/main/resources/org/apache/spark/ui/static/webui.js
new file mode 100644
index 0000000000..e37307aa1f
--- /dev/null
+++ b/core/src/main/resources/org/apache/spark/ui/static/webui.js
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+function collapseTablePageLoad(name, table){
+ if (window.localStorage.getItem(name) == "true") {
+ // Set it to false so that the click function can revert it
+ window.localStorage.setItem(name, "false");
+ collapseTable(name, table);
+ }
+}
+
+function collapseTable(thisName, table){
+ var status = window.localStorage.getItem(thisName) == "true";
+ status = !status;
+
+ thisClass = '.' + thisName
+
+ // Expand the list of additional metrics.
+ var tableDiv = $(thisClass).parent().find('.' + table);
+ $(tableDiv).toggleClass('collapsed');
+
+ // Switch the class of the arrow from open to closed.
+ $(thisClass).find('.collapse-table-arrow').toggleClass('arrow-open');
+ $(thisClass).find('.collapse-table-arrow').toggleClass('arrow-closed');
+
+ window.localStorage.setItem(thisName, "" + status);
+}
+
+// Add a call to collapseTablePageLoad() on each collapsible table
+// to remember if it's collapsed on each page reload
+$(function() {
+ collapseTablePageLoad('collapse-aggregated-metrics','aggregated-metrics');
+}); \ No newline at end of file