Skip to content

Commit

Permalink
Added scroll limit to Job timeline
Browse files Browse the repository at this point in the history
  • Loading branch information
sarutak committed Apr 23, 2015
1 parent 974a64a commit 8110acf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function drawApplicationTimeline(groupArray, eventObjArray, startTime) {
});
}

function drawJobTimeline(groupArray, eventObjArray) {
function drawJobTimeline(groupArray, eventObjArray, startTime) {
var groups = new vis.DataSet(groupArray);
var items = new vis.DataSet(eventObjArray);
var container = $('#job-timeline')[0];
Expand All @@ -55,6 +55,7 @@ function drawJobTimeline(groupArray, eventObjArray) {
},
editable: false,
showCurrentTime: false,
min: startTime,
zoomable: false,
};

Expand Down
12 changes: 9 additions & 3 deletions core/src/main/scala/org/apache/spark/ui/jobs/JobPage.scala
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,11 @@ private[ui] class JobPage(parent: JobsTab) extends WebUIPage("job") {
events.toSeq
}

private def makeTimeline(stages: Seq[StageInfo], executors: Seq[ExecutorUIData]): Seq[Node] = {
private def makeTimeline(
stages: Seq[StageInfo],
executors: Seq[ExecutorUIData],
jobStartTime: Long): Seq[Node] = {

val stageEventJsonAsStrSeq = makeStageEvent(stages)
val executorsJsonAsStrSeq = makeExecutorEvent(executors)

Expand Down Expand Up @@ -167,7 +171,7 @@ private[ui] class JobPage(parent: JobsTab) extends WebUIPage("job") {
</div> ++
<div id="job-timeline"></div> ++
<script type="text/javascript">
{Unparsed(s"drawJobTimeline(${groupJsonArrayAsStr}, ${eventArrayAsStr});")}
{Unparsed(s"drawJobTimeline(${groupJsonArrayAsStr}, ${eventArrayAsStr}, ${jobStartTime});")}
</script>
}

Expand Down Expand Up @@ -297,8 +301,10 @@ private[ui] class JobPage(parent: JobsTab) extends WebUIPage("job") {
</div>

var content = summary
val jobStartTime = jobData.submissionTime.get
content ++= <h4>Events on Job Timeline</h4> ++
makeTimeline(activeStages ++ completedStages ++ failedStages, listener.executors)
makeTimeline(activeStages ++ completedStages ++ failedStages,
listener.executors, jobStartTime)

if (shouldShowActiveStages) {
content ++= <h4 id="active">Active Stages ({activeStages.size})</h4> ++
Expand Down

0 comments on commit 8110acf

Please sign in to comment.