Skip to content
Snippets Groups Projects
Commit 2b35c99c authored by zhichao.li's avatar zhichao.li Committed by Sean Owen
Browse files

[SPARK-7717] [WEBUI] Only showing total memory and cores for alive workers

Author: zhichao.li <zhichao.li@intel.com>

Closes #6317 from zhichao-li/workers and squashes the following commits:

d68bf11 [zhichao.li] change prefix
99b6768 [zhichao.li] remove extra space and add 'Alive' prefix
1e8eb06 [zhichao.li] only showing alive workers
parent 9d8aadb7
No related branches found
No related tags found
No related merge requests found
...@@ -75,6 +75,7 @@ private[ui] class MasterPage(parent: MasterWebUI) extends WebUIPage("") { ...@@ -75,6 +75,7 @@ private[ui] class MasterPage(parent: MasterWebUI) extends WebUIPage("") {
val workerHeaders = Seq("Worker Id", "Address", "State", "Cores", "Memory") val workerHeaders = Seq("Worker Id", "Address", "State", "Cores", "Memory")
val workers = state.workers.sortBy(_.id) val workers = state.workers.sortBy(_.id)
val aliveWorkers = state.workers.filter(_.state == WorkerState.ALIVE)
val workerTable = UIUtils.listingTable(workerHeaders, workerRow, workers) val workerTable = UIUtils.listingTable(workerHeaders, workerRow, workers)
val appHeaders = Seq("Application ID", "Name", "Cores", "Memory per Node", "Submitted Time", val appHeaders = Seq("Application ID", "Name", "Cores", "Memory per Node", "Submitted Time",
...@@ -108,12 +109,12 @@ private[ui] class MasterPage(parent: MasterWebUI) extends WebUIPage("") { ...@@ -108,12 +109,12 @@ private[ui] class MasterPage(parent: MasterWebUI) extends WebUIPage("") {
</li> </li>
}.getOrElse { Seq.empty } }.getOrElse { Seq.empty }
} }
<li><strong>Workers:</strong> {state.workers.size}</li> <li><strong>Alive Workers:</strong> {aliveWorkers.size}</li>
<li><strong>Cores:</strong> {state.workers.map(_.cores).sum} Total, <li><strong>Cores in use:</strong> {aliveWorkers.map(_.cores).sum} Total,
{state.workers.map(_.coresUsed).sum} Used</li> {aliveWorkers.map(_.coresUsed).sum} Used</li>
<li><strong>Memory:</strong> <li><strong>Memory in use:</strong>
{Utils.megabytesToString(state.workers.map(_.memory).sum)} Total, {Utils.megabytesToString(aliveWorkers.map(_.memory).sum)} Total,
{Utils.megabytesToString(state.workers.map(_.memoryUsed).sum)} Used</li> {Utils.megabytesToString(aliveWorkers.map(_.memoryUsed).sum)} Used</li>
<li><strong>Applications:</strong> <li><strong>Applications:</strong>
{state.activeApps.size} Running, {state.activeApps.size} Running,
{state.completedApps.size} Completed </li> {state.completedApps.size} Completed </li>
......
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