Repository: spark Updated Branches: refs/heads/master 67e59d464 -> e98eb2146
[SPARK-16673][WEB UI] New Executor Page removed conditional for Logs and Thread Dump columns ## What changes were proposed in this pull request? When #13670 switched `ExecutorsPage` to use JQuery DataTables it incidentally removed the conditional for the Logs and Thread Dump columns. I reimplemented the conditional display of the Logs and Thread dump columns as it was before the switch. ## How was this patch tested? Manually tested and dev/run-tests ![both](https://cloud.githubusercontent.com/assets/13952758/17186879/da8dd1a8-53eb-11e6-8b0c-d0ff0156a9a7.png) ![dump](https://cloud.githubusercontent.com/assets/13952758/17186881/dab08a04-53eb-11e6-8b1c-50ffd0bf2ae8.png) ![logs](https://cloud.githubusercontent.com/assets/13952758/17186880/dab04d00-53eb-11e6-8754-68dd64d6d9f4.png) Author: Alex Bozarth <ajboz...@us.ibm.com> Closes #14382 from ajbozarth/spark16673. Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/e98eb214 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/e98eb214 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/e98eb214 Branch: refs/heads/master Commit: e98eb2146f1363956bfc3e5adcc11c246182d617 Parents: 67e59d4 Author: Alex Bozarth <ajboz...@us.ibm.com> Authored: Fri Aug 19 10:04:20 2016 -0500 Committer: Tom Graves <tgra...@yahoo-inc.com> Committed: Fri Aug 19 10:04:20 2016 -0500 ---------------------------------------------------------------------- .../org/apache/spark/ui/static/executorspage.js | 38 ++++++++++++++++---- .../apache/spark/ui/exec/ExecutorsPage.scala | 7 ++-- 2 files changed, 34 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/e98eb214/core/src/main/resources/org/apache/spark/ui/static/executorspage.js ---------------------------------------------------------------------- diff --git a/core/src/main/resources/org/apache/spark/ui/static/executorspage.js b/core/src/main/resources/org/apache/spark/ui/static/executorspage.js index b2b2363..1df6733 100644 --- a/core/src/main/resources/org/apache/spark/ui/static/executorspage.js +++ b/core/src/main/resources/org/apache/spark/ui/static/executorspage.js @@ -15,6 +15,16 @@ * limitations under the License. */ +var threadDumpEnabled = false; + +function setThreadDumpEnabled(val) { + threadDumpEnabled = val; +} + +function getThreadDumpEnabled() { + return threadDumpEnabled; +} + function formatStatus(status, type) { if (type !== 'display') return status; if (status) { @@ -116,6 +126,12 @@ function formatLogsCells(execLogs, type) { return result; } +function logsExist(execs) { + return execs.some(function(exec) { + return !($.isEmptyObject(exec["executorLogs"])); + }); +} + // Determine Color Opacity from 0.5-1 // activeTasks range from 0 to maxTasks function activeTasksAlpha(activeTasks, maxTasks) { @@ -143,18 +159,16 @@ function totalDurationAlpha(totalGCTime, totalDuration) { (Math.min(totalGCTime / totalDuration + 0.5, 1)) : 1; } +// When GCTimePercent is edited change ToolTips.TASK_TIME to match +var GCTimePercent = 0.1; + function totalDurationStyle(totalGCTime, totalDuration) { // Red if GC time over GCTimePercent of total time - // When GCTimePercent is edited change ToolTips.TASK_TIME to match - var GCTimePercent = 0.1; return (totalGCTime > GCTimePercent * totalDuration) ? ("hsla(0, 100%, 50%, " + totalDurationAlpha(totalGCTime, totalDuration) + ")") : ""; } function totalDurationColor(totalGCTime, totalDuration) { - // Red if GC time over GCTimePercent of total time - // When GCTimePercent is edited change ToolTips.TASK_TIME to match - var GCTimePercent = 0.1; return (totalGCTime > GCTimePercent * totalDuration) ? "white" : "black"; } @@ -392,8 +406,18 @@ $(document).ready(function () { {data: 'executorLogs', render: formatLogsCells}, { data: 'id', render: function (data, type) { - return type === 'display' ? ("<a href='threadDump/?executorId=" + data + "'>Thread Dump</a>" ) : data; + return type === 'display' ? ("<a href='threadDump/?executorId=" + data + "'>Thread Dump</a>" ) : data; + } } + ], + "columnDefs": [ + { + "targets": [ 15 ], + "visible": logsExist(response) + }, + { + "targets": [ 16 ], + "visible": getThreadDumpEnabled() } ], "order": [[0, "asc"]] @@ -458,7 +482,7 @@ $(document).ready(function () { "paging": false, "searching": false, "info": false - + }; $(sumSelector).DataTable(sumConf); http://git-wip-us.apache.org/repos/asf/spark/blob/e98eb214/core/src/main/scala/org/apache/spark/ui/exec/ExecutorsPage.scala ---------------------------------------------------------------------- diff --git a/core/src/main/scala/org/apache/spark/ui/exec/ExecutorsPage.scala b/core/src/main/scala/org/apache/spark/ui/exec/ExecutorsPage.scala index 287390b..982e891 100644 --- a/core/src/main/scala/org/apache/spark/ui/exec/ExecutorsPage.scala +++ b/core/src/main/scala/org/apache/spark/ui/exec/ExecutorsPage.scala @@ -50,16 +50,15 @@ private[ui] class ExecutorsPage( threadDumpEnabled: Boolean) extends WebUIPage("") { private val listener = parent.listener - // When GCTimePercent is edited change ToolTips.TASK_TIME to match - private val GCTimePercent = 0.1 def render(request: HttpServletRequest): Seq[Node] = { val content = <div> { - <div id="active-executors"></div> ++ + <div id="active-executors"></div> ++ <script src={UIUtils.prependBaseUri("/static/utils.js")}></script> ++ - <script src={UIUtils.prependBaseUri("/static/executorspage.js")}></script> + <script src={UIUtils.prependBaseUri("/static/executorspage.js")}></script> ++ + <script>setThreadDumpEnabled({threadDumpEnabled})</script> } </div>; --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org