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