Skip to content

Commit 6693f34

Browse files
committed
Added link to job/stage box in the timeline in order to move to corresponding row when we click
1 parent 8f88222 commit 6693f34

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

core/src/main/resources/org/apache/spark/ui/static/timeline-view.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ function drawApplicationTimeline(groupArray, eventObjArray) {
3434
applicationTimeline.setItems(items);
3535

3636
setupZoomable("#application-timeline-zoom-lock", applicationTimeline);
37+
38+
$(".item.range.job.application-timeline-object").each(function() {
39+
$(this).click(function() {
40+
var jobIdText = $($(this).find(".application-timeline-content")[0]).text();
41+
var jobId = jobIdText.match("\\(Job (\\d+)\\)")[1];
42+
window.location.href = "#job-" + jobId;
43+
});
44+
});
3745
}
3846

3947
function drawJobTimeline(groupArray, eventObjArray) {
@@ -55,6 +63,18 @@ function drawJobTimeline(groupArray, eventObjArray) {
5563
jobTimeline.setItems(items);
5664

5765
setupZoomable("#job-timeline-zoom-lock", jobTimeline);
66+
67+
$(".item.range.stage.job-timeline-object").each(function() {
68+
$(this).click(function() {
69+
var stageIdText = $($(this).find(".job-timeline-content")[0]).text();
70+
var stageId = stageIdText.match("\\(Stage (\\d+\\.\\d+)\\)")[1].replace(".", "-");
71+
window.location.href = "#stage-" + stageId;
72+
});
73+
});
74+
}
75+
76+
function setupJobEntryLink(id, timeline) {
77+
$(id +'')
5878
}
5979

6080
function setupZoomable(id, timeline) {

core/src/main/scala/org/apache/spark/ui/jobs/AllJobsPage.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ private[ui] class AllJobsPage(parent: JobsTab) extends WebUIPage("") {
191191
val formattedSubmissionTime = job.submissionTime.map(UIUtils.formatDate).getOrElse("Unknown")
192192
val detailUrl =
193193
"%s/jobs/job?id=%s".format(UIUtils.prependBaseUri(parent.basePath), job.jobId)
194-
<tr>
194+
<tr id={"job-" + job.jobId}>
195195
<td sorttable_customkey={job.jobId.toString}>
196196
{job.jobId} {job.jobGroup.map(id => s"($id)").getOrElse("")}
197197
</td>

core/src/main/scala/org/apache/spark/ui/jobs/StageTable.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@ private[ui] class StageTableBase(
175175
}
176176

177177
/** Render an HTML row that represents a stage */
178-
private def renderStageRow(s: StageInfo): Seq[Node] = <tr>{stageRow(s)}</tr>
178+
private def renderStageRow(s: StageInfo): Seq[Node] =
179+
<tr id={"stage-" + s.stageId + "-" + s.attemptId}>{stageRow(s)}</tr>
179180
}
180181

181182
private[ui] class FailedStageTable(

0 commit comments

Comments
 (0)