Skip to content

Commit

Permalink
[SPARK-7717] [WEBUI] Only showing total memory and cores for alive wo…
Browse files Browse the repository at this point in the history
…rkers

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

Closes apache#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
  • Loading branch information
zhichao-li authored and nemccarthy committed Jun 19, 2015
1 parent ded4f87 commit 0d9cc4a
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ private[ui] class MasterPage(parent: MasterWebUI) extends WebUIPage("") {

val workerHeaders = Seq("Worker Id", "Address", "State", "Cores", "Memory")
val workers = state.workers.sortBy(_.id)
val aliveWorkers = state.workers.filter(_.state == WorkerState.ALIVE)
val workerTable = UIUtils.listingTable(workerHeaders, workerRow, workers)

val appHeaders = Seq("Application ID", "Name", "Cores", "Memory per Node", "Submitted Time",
Expand Down Expand Up @@ -108,12 +109,12 @@ private[ui] class MasterPage(parent: MasterWebUI) extends WebUIPage("") {
</li>
}.getOrElse { Seq.empty }
}
<li><strong>Workers:</strong> {state.workers.size}</li>
<li><strong>Cores:</strong> {state.workers.map(_.cores).sum} Total,
{state.workers.map(_.coresUsed).sum} Used</li>
<li><strong>Memory:</strong>
{Utils.megabytesToString(state.workers.map(_.memory).sum)} Total,
{Utils.megabytesToString(state.workers.map(_.memoryUsed).sum)} Used</li>
<li><strong>Alive Workers:</strong> {aliveWorkers.size}</li>
<li><strong>Cores in use:</strong> {aliveWorkers.map(_.cores).sum} Total,
{aliveWorkers.map(_.coresUsed).sum} Used</li>
<li><strong>Memory in use:</strong>
{Utils.megabytesToString(aliveWorkers.map(_.memory).sum)} Total,
{Utils.megabytesToString(aliveWorkers.map(_.memoryUsed).sum)} Used</li>
<li><strong>Applications:</strong>
{state.activeApps.size} Running,
{state.completedApps.size} Completed </li>
Expand Down

0 comments on commit 0d9cc4a

Please sign in to comment.