Skip to content
Snippets Groups Projects
Commit 3b0e4449 authored by CodingCat's avatar CodingCat Committed by Josh Rosen
Browse files

[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
parent 1633d0a2
No related branches found
No related tags found
No related merge requests found
......@@ -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
......@@ -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">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment