Skip to content
Snippets Groups Projects
Commit ca1903ea authored by Karen Feng's avatar Karen Feng
Browse files

Overlays progress text on top of bar

parent 099528b6
No related branches found
No related tags found
No related merge requests found
...@@ -37,7 +37,7 @@ private[spark] class StageTable(val stages: Seq[Stage], val parent: JobProgressU ...@@ -37,7 +37,7 @@ private[spark] class StageTable(val stages: Seq[Stage], val parent: JobProgressU
<th>Origin</th> <th>Origin</th>
<th>Submitted</th> <th>Submitted</th>
<td>Duration</td> <td>Duration</td>
<td colspan="2">Tasks: Succeeded/Total</td> <td>Tasks: Succeeded/Total</td>
<td>Shuffle Read</td> <td>Shuffle Read</td>
<td>Shuffle Write</td> <td>Shuffle Write</td>
</thead> </thead>
...@@ -54,11 +54,14 @@ private[spark] class StageTable(val stages: Seq[Stage], val parent: JobProgressU ...@@ -54,11 +54,14 @@ private[spark] class StageTable(val stages: Seq[Stage], val parent: JobProgressU
} }
} }
def makeProgressBar(started: Int, completed: Int, total: Int): Seq[Node] = { def makeProgressBar(started: Int, completed: Int, failed: String, total: Int): Seq[Node] = {
val completeWidth = "width: %s%%".format((completed.toDouble/total)*100) val completeWidth = "width: %s%%".format((completed.toDouble/total)*100)
val startWidth = "width: %s%%".format((started.toDouble/total)*100) val startWidth = "width: %s%%".format((started.toDouble/total)*100)
<div class="progress" style="height: 15px; margin-bottom: 0px"> <div class="progress" style="height: 15px; margin-bottom: 0px; position: relative">
<span style="text-align:center; position:absolute; width:100%;">
{completed}/{total} {failed}
</span>
<div class="bar" style={completeWidth}></div> <div class="bar" style={completeWidth}></div>
<div class="bar bar-info" style={startWidth}></div> <div class="bar bar-info" style={startWidth}></div>
</div> </div>
...@@ -82,6 +85,10 @@ private[spark] class StageTable(val stages: Seq[Stage], val parent: JobProgressU ...@@ -82,6 +85,10 @@ private[spark] class StageTable(val stages: Seq[Stage], val parent: JobProgressU
val startedTasks = listener.stageToTasksActive.getOrElse(s.id, HashSet[TaskInfo]()).size val startedTasks = listener.stageToTasksActive.getOrElse(s.id, HashSet[TaskInfo]()).size
val completedTasks = listener.stageToTasksComplete.getOrElse(s.id, 0) val completedTasks = listener.stageToTasksComplete.getOrElse(s.id, 0)
val failedTasks = listener.stageToTasksFailed.getOrElse(s.id, 0) match {
case f if f > 0 => "(%s failed)".format(f)
case _ => ""
}
val totalTasks = s.numPartitions val totalTasks = s.numPartitions
val poolName = listener.stageToPool.get(s) val poolName = listener.stageToPool.get(s)
...@@ -95,12 +102,8 @@ private[spark] class StageTable(val stages: Seq[Stage], val parent: JobProgressU ...@@ -95,12 +102,8 @@ private[spark] class StageTable(val stages: Seq[Stage], val parent: JobProgressU
<td>{submissionTime}</td> <td>{submissionTime}</td>
<td>{getElapsedTime(s.submissionTime, <td>{getElapsedTime(s.submissionTime,
s.completionTime.getOrElse(System.currentTimeMillis()))}</td> s.completionTime.getOrElse(System.currentTimeMillis()))}</td>
<td class="progress-cell">{makeProgressBar(startedTasks, completedTasks, totalTasks)}</td> <td class="progress-cell">
<td style="border-left: 0; text-align: center;">{completedTasks} / {totalTasks} {makeProgressBar(startedTasks, completedTasks, failedTasks, totalTasks)}
{listener.stageToTasksFailed.getOrElse(s.id, 0) match {
case f if f > 0 => "(%s failed)".format(f)
case _ =>
}}
</td> </td>
<td>{shuffleRead}</td> <td>{shuffleRead}</td>
<td>{shuffleWrite}</td> <td>{shuffleWrite}</td>
......
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