dongjoon-hyun commented on code in PR #51197:
URL: https://github.com/apache/spark/pull/51197#discussion_r2152474989
##########
core/src/main/scala/org/apache/spark/ui/exec/ExecutorThreadDumpPage.scala:
##########
@@ -154,5 +153,32 @@ private[ui] class ExecutorThreadDumpPage(
</div>
</div>
}
- // scalastyle:off
+
+
+ private def threadDumpSummary(threadDump: Array[ThreadStackTrace]):
Seq[Node] = {
+ val totalCount = threadDump.length
+ <div>
+ <span class="thead-dump-summary collapse-table"
onClick="collapseTable('thead-dump-summary', 'thread-dump-summary-table')">
+ <h4>
+ <span class="collapse-table-arrow arrow-open"></span>
+ <a>Thread Dump Summary: { totalCount }</a>
+ </h4>
+ </span>
+ <table class={UIUtils.TABLE_CLASS_STRIPED + " accordion-group" + "
sortable" + " thread-dump-summary-table collapsible-table"}>
+ <thead><th>Thread State</th><th>Count</th><th>Percentage</th></thead>
+ <tbody>
+ {
+ threadDump.groupBy(_.threadState).map { case (state, threads) =>
+ <tr>
+ <td>{state}</td>
+ <td>{threads.length}</td>
+ <td>{"%.2f%%".format(threads.length * 100.0 / totalCount)}</td>
Review Comment:
Although there is a tiny rounding error which the total sum is greater than
100%, +1 for this simple logic.

--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]