Skip to content
Snippets Groups Projects
Commit 249f0e54 authored by Patrick Wendell's avatar Patrick Wendell
Browse files

Minor changes from Matei's review

parent c537e869
No related branches found
No related tags found
No related merge requests found
......@@ -160,8 +160,8 @@ private[spark] object UIUtils {
{jobs}
</ul>
<ul id="infolist">
<li>Master: <strong>{sc.master}</strong></li>
<li>Application: <strong>{sc.appName}</strong></li>
<li>Master: <strong>{sc.master}</strong></li>
<li>Executors: <strong>{sc.getExecutorStorageStatus.size}</strong></li>
</ul>
</div>
......
package spark.ui.jobs
import akka.util.Duration
import java.util.Date
import javax.servlet.http.HttpServletRequest
......@@ -26,9 +24,9 @@ private[spark] class IndexPage(parent: JobProgressUI) {
val completedStages = listener.completedStages.reverse.toSeq
val failedStages = listener.failedStages.reverse.toSeq
val activeStageTable: NodeSeq = listingTable(stageHeaders, stageRow(), activeStages)
val completedStageTable = listingTable(stageHeaders, stageRow(), completedStages)
val failedStageTable: NodeSeq = listingTable(stageHeaders, stageRow(false), failedStages)
val activeStageTable: NodeSeq = listingTable(stageHeaders, stageRow, activeStages)
val completedStageTable = listingTable(stageHeaders, stageRow, completedStages)
val failedStageTable: NodeSeq = listingTable(stageHeaders, stageRow, failedStages)
val content = <h2>Active Stages</h2> ++ activeStageTable ++
<h2>Completed Stages</h2> ++ completedStageTable ++
......@@ -44,7 +42,7 @@ private[spark] class IndexPage(parent: JobProgressUI) {
}
}
def makeSlider(completed: Int, total: Int): Seq[Node] = {
def makeProgressBar(completed: Int, total: Int): Seq[Node] = {
val width=130
val height=15
val completeWidth = (completed.toDouble / total) * width
......@@ -53,12 +51,12 @@ private[spark] class IndexPage(parent: JobProgressUI) {
<rect width={width.toString} height={height.toString}
fill="white" stroke="black" stroke-width="1" />
<rect width={completeWidth.toString} height={height.toString}
fill="rgb(206,206,247)" stroke="black" stroke-width="1" />
fill="rgb(51,51,51)" stroke="black" stroke-width="1" />
</svg>
}
def stageRow(showLink: Boolean = true)(s: Stage): Seq[Node] = {
def stageRow(s: Stage): Seq[Node] = {
val submissionTime = s.submissionTime match {
case Some(t) => dateFmt.format(new Date(t))
case None => "Unknown"
......@@ -74,13 +72,12 @@ private[spark] class IndexPage(parent: JobProgressUI) {
val totalTasks = s.numPartitions
<tr>
{if (showLink) {<td><a href={"/stages/stage?id=%s".format(s.id)}>{s.id}</a></td>}
else {<td>{s.id}</td>}}
<td>{s.origin}</td>
<td>{s.id}</td>
<td><a href={"/stages/stage?id=%s".format(s.id)}>{s.origin}</a></td>
<td>{submissionTime}</td>
<td>{getElapsedTime(s.submissionTime,
s.completionTime.getOrElse(System.currentTimeMillis()))}</td>
<td>{makeSlider(completedTasks, totalTasks)}</td>
<td>{makeProgressBar(completedTasks, totalTasks)}</td>
<td>{completedTasks} / {totalTasks}
{listener.stageToTasksFailed.getOrElse(s.id, 0) match {
case f if f > 0 => "(%s failed)".format(f)
......
......@@ -23,7 +23,7 @@ import spark.Utils
private[spark] class JobProgressUI(val sc: SparkContext) {
private var _listener: Option[JobProgressListener] = None
def listener = _listener.get
val dateFmt = new SimpleDateFormat("EEE, MMM d yyyy HH:mm:ss")
val dateFmt = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss")
private val indexPage = new IndexPage(this)
private val stagePage = new StagePage(this)
......
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