Skip to content

Commit c758db0

Browse files
committed
[SPARK-25577][Web UI] Add an on-off switch to display the executor additional columns
1 parent a2f502c commit c758db0

File tree

5 files changed

+41
-9
lines changed

5 files changed

+41
-9
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
$("#show-additional-columns").change(function () {
19+
if ($(this).is(':checked')) {
20+
$(".additional_column").css("display", "table-cell");
21+
} else {
22+
$(".additional_column").css("display", "none");
23+
}
24+
});

core/src/main/resources/org/apache/spark/ui/static/executorspage-template.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ <h4 style="clear: left; display: inline-block;">Summary</h4>
2626
<th><span data-toggle="tooltip"
2727
title="Memory used / total available memory for storage of data like RDD partitions cached in memory.">Storage Memory</span>
2828
</th>
29-
<th class="on_heap_memory">
29+
<th class="on_heap_memory additional_column">
3030
<span data-toggle="tooltip"
3131
title="Memory used / total available memory for on heap storage of data like RDD partitions cached in memory.">On Heap Storage Memory</span>
3232
</th>
33-
<th class="off_heap_memory">
33+
<th class="off_heap_memory additional_column">
3434
<span data-toggle="tooltip"
3535
title="Memory used / total available memory for off heap storage of data like RDD partitions cached in memory.">Off Heap Storage Memory</span>
3636
</th>
@@ -81,11 +81,11 @@ <h4 style="clear: left; display: inline-block;">Executors</h4>
8181
<span data-toggle="tooltip" data-placement="top"
8282
title="Memory used / total available memory for storage of data like RDD partitions cached in memory.">
8383
Storage Memory</span></th>
84-
<th class="on_heap_memory">
84+
<th class="on_heap_memory additional_column">
8585
<span data-toggle="tooltip" data-placement="top"
8686
title="Memory used / total available memory for on heap storage of data like RDD partitions cached in memory.">
8787
On Heap Storage Memory</span></th>
88-
<th class="off_heap_memory">
88+
<th class="off_heap_memory additional_column">
8989
<span data-toggle="tooltip"
9090
title="Memory used / total available memory for off heap storage of data like RDD partitions cached in memory.">
9191
Off Heap Storage Memory</span></th>

core/src/main/resources/org/apache/spark/ui/static/executorspage.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ $(document).ready(function () {
446446
formatBytes(row.memoryMetrics.totalOnHeapStorageMemory, type));
447447
},
448448
"fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
449-
$(nTd).addClass('on_heap_memory')
449+
$(nTd).addClass('on_heap_memory additional_column')
450450
}
451451
},
452452
{
@@ -458,7 +458,7 @@ $(document).ready(function () {
458458
formatBytes(row.memoryMetrics.totalOffHeapStorageMemory, type));
459459
},
460460
"fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
461-
$(nTd).addClass('off_heap_memory')
461+
$(nTd).addClass('off_heap_memory additional_column')
462462
}
463463
},
464464
{data: 'diskUsed', render: formatBytes},
@@ -512,7 +512,6 @@ $(document).ready(function () {
512512
dt.column('executorLogsCol:name').visible(logsExist(response));
513513
dt.column('threadDumpCol:name').visible(getThreadDumpEnabled());
514514
$('#active-executors [data-toggle="tooltip"]').tooltip();
515-
516515
var sumSelector = "#summary-execs-table";
517516
var sumConf = {
518517
"data": [activeSummary, deadSummary, totalSummary],
@@ -542,7 +541,7 @@ $(document).ready(function () {
542541
formatBytes(row.allOnHeapMaxMemory, type));
543542
},
544543
"fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
545-
$(nTd).addClass('on_heap_memory')
544+
$(nTd).addClass('on_heap_memory additional_column')
546545
}
547546
},
548547
{
@@ -554,7 +553,7 @@ $(document).ready(function () {
554553
formatBytes(row.allOffHeapMaxMemory, type));
555554
},
556555
"fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
557-
$(nTd).addClass('off_heap_memory')
556+
$(nTd).addClass('off_heap_memory additional_column')
558557
}
559558
},
560559
{data: 'allDiskUsed', render: formatBytes},

core/src/main/resources/org/apache/spark/ui/static/webui.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,11 @@ span.additional-metric-title {
210210
display: none;
211211
}
212212

213+
/* Additional columns will be hidden by default */
214+
.additional_column {
215+
display: none;
216+
}
217+
213218
.accordion-inner {
214219
background: #f5f5f5;
215220
}

core/src/main/scala/org/apache/spark/ui/exec/ExecutorsTab.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,12 @@ private[ui] class ExecutorsPage(
4848
val content =
4949
<div>
5050
{
51+
<div><input type="checkbox" id="show-additional-columns">
52+
Show additional columns</input></div> ++
5153
<div id="active-executors" class="row-fluid"></div> ++
5254
<script src={UIUtils.prependBaseUri(request, "/static/utils.js")}></script> ++
55+
<script src={UIUtils.prependBaseUri(request,
56+
"/static/executorspage-common.js")}></script> ++
5357
<script src={UIUtils.prependBaseUri(request, "/static/executorspage.js")}></script> ++
5458
<script>setThreadDumpEnabled({threadDumpEnabled})</script>
5559
}

0 commit comments

Comments
 (0)