diff options
author | CodingCat <zhunansjtu@gmail.com> | 2015-08-03 18:20:40 -0700 |
---|---|---|
committer | Josh Rosen <joshrosen@databricks.com> | 2015-08-03 18:20:56 -0700 |
commit | 93076ae39b58ba8c4a459f2b3a8590c492dc5c4e (patch) | |
tree | 9b640c884a156721cb1319b0d4a4887163d53c32 | |
parent | 34335719a372c1951fdb4dd25b75b086faf1076f (diff) | |
download | spark-93076ae39b58ba8c4a459f2b3a8590c492dc5c4e.tar.gz spark-93076ae39b58ba8c4a459f2b3a8590c492dc5c4e.tar.bz2 spark-93076ae39b58ba8c4a459f2b3a8590c492dc5c4e.zip |
[SPARK-8416] highlight and topping the executor threads in thread dumping page
https://issues.apache.org/jira/browse/SPARK-8416
To facilitate debugging, I made this patch with three changes:
* render the executor-thread and non executor-thread entries with different background colors
* put the executor threads on the top of the list
* sort the threads alphabetically
Author: CodingCat <zhunansjtu@gmail.com>
Closes #7808 from CodingCat/SPARK-8416 and squashes the following commits:
34fc708 [CodingCat] fix className
d7b79dd [CodingCat] lowercase threadName
d032882 [CodingCat] sort alphabetically and change the css class name
f0513b1 [CodingCat] change the color & group threads by name
2da6e06 [CodingCat] small fix
3fc9f36 [CodingCat] define classes in webui.css
8ee125e [CodingCat] highlight and put on top the executor threads in thread dumping page
(cherry picked from commit 3b0e44490aebfba30afc147e4a34a63439d985c6)
Signed-off-by: Josh Rosen <joshrosen@databricks.com>
-rw-r--r-- | core/src/main/resources/org/apache/spark/ui/static/webui.css | 8 | ||||
-rw-r--r-- | core/src/main/scala/org/apache/spark/ui/exec/ExecutorThreadDumpPage.scala | 24 |
2 files changed, 29 insertions, 3 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 648cd1b104..04f3070d25 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 @@ -224,3 +224,11 @@ span.additional-metric-title { a.expandbutton { cursor: pointer; } + +.executor-thread { + background: #E6E6E6; +} + +.non-executor-thread { + background: #FAFAFA; +}
\ No newline at end of file diff --git a/core/src/main/scala/org/apache/spark/ui/exec/ExecutorThreadDumpPage.scala b/core/src/main/scala/org/apache/spark/ui/exec/ExecutorThreadDumpPage.scala index f0ae95bb8c..b0a2cb4aa4 100644 --- a/core/src/main/scala/org/apache/spark/ui/exec/ExecutorThreadDumpPage.scala +++ b/core/src/main/scala/org/apache/spark/ui/exec/ExecutorThreadDumpPage.scala @@ -49,11 +49,29 @@ private[ui] class ExecutorThreadDumpPage(parent: ExecutorsTab) extends WebUIPage val maybeThreadDump = sc.get.getExecutorThreadDump(executorId) val content = maybeThreadDump.map { threadDump => - val dumpRows = threadDump.map { thread => + val dumpRows = threadDump.sortWith { + case (threadTrace1, threadTrace2) => { + val v1 = if (threadTrace1.threadName.contains("Executor task launch")) 1 else 0 + val v2 = if (threadTrace2.threadName.contains("Executor task launch")) 1 else 0 + if (v1 == v2) { + threadTrace1.threadName.toLowerCase < threadTrace2.threadName.toLowerCase + } else { + v1 > v2 + } + } + }.map { thread => + val threadName = thread.threadName + val className = "accordion-heading " + { + if (threadName.contains("Executor task launch")) { + "executor-thread" + } else { + "non-executor-thread" + } + } <div class="accordion-group"> - <div class="accordion-heading" onclick="$(this).next().toggleClass('hidden')"> + <div class={className} onclick="$(this).next().toggleClass('hidden')"> <a class="accordion-toggle"> - Thread {thread.threadId}: {thread.threadName} ({thread.threadState}) + Thread {thread.threadId}: {threadName} ({thread.threadState}) </a> </div> <div class="accordion-body hidden"> |