Skip to content

Commit

Permalink
only showing alive workers
Browse files Browse the repository at this point in the history
  • Loading branch information
zhichao-li committed May 21, 2015
1 parent 8fd5535 commit 1e8eb06
Showing 1 changed file with 6 additions and 5 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>Workers:</strong> {aliveWorkers.size}</li>
<li><strong>Cores:</strong> {aliveWorkers.map(_.cores).sum} Total,
{aliveWorkers.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>
{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 1e8eb06

Please sign in to comment.