aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorCodingCat <zhunansjtu@gmail.com>2015-08-03 18:20:40 -0700
committerJosh Rosen <joshrosen@databricks.com>2015-08-03 18:20:40 -0700
commit3b0e44490aebfba30afc147e4a34a63439d985c6 (patch)
treeaf59531e528e20c83fa611e5bb81fedab62eeca6 /core
parent1633d0a2612d94151f620c919425026150e69ae1 (diff)
downloadspark-3b0e44490aebfba30afc147e4a34a63439d985c6.tar.gz
spark-3b0e44490aebfba30afc147e4a34a63439d985c6.tar.bz2
spark-3b0e44490aebfba30afc147e4a34a63439d985c6.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
Diffstat (limited to 'core')
-rw-r--r--core/src/main/resources/org/apache/spark/ui/static/webui.css8
-rw-r--r--core/src/main/scala/org/apache/spark/ui/exec/ExecutorThreadDumpPage.scala24
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">