-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-3468][WebUI] Timeline-View feature #2342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 25 commits
082f709
5ce1b21
a76e569
e85e9aa
d05f2c2
9fb522e
16f82cf
09cce97
dab7cc1
fcdab7d
dec85db
52b5f0b
68b7540
19815ae
0fc6a31
999ccd4
fc1696c
aeed4b1
8f88222
6693f34
6a91872
ee7a7f0
974a64a
8110acf
0dc4278
28714b6
a36291b
d3c63c8
b09d0c5
ef34a5b
a91abd3
79ac03d
11fe67d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,114 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| div#application-timeline, div#job-timeline { | ||
| margin-bottom: 30px; | ||
| } | ||
|
|
||
| #application-timeline div.legend-area { | ||
| margin-top: 20px; | ||
| } | ||
|
|
||
| .vis.timeline div.content { | ||
| width: 100%; | ||
| } | ||
|
|
||
| .vis.timeline .item.stage.succeeded { | ||
| background-color: #D5DDF6; | ||
| } | ||
|
|
||
| .vis.timeline .item.stage.succeeded.selected { | ||
| background-color: #D5DDF6; | ||
| border-color: #97B0F8; | ||
| z-index: auto; | ||
| } | ||
|
|
||
| .vis.timeline .item.stage { | ||
| cursor: pointer; | ||
| } | ||
|
|
||
| .vis.timeline .item.stage.failed { | ||
| background-color: #FF5475; | ||
| } | ||
|
|
||
| .vis.timeline .item.stage.failed.selected { | ||
| background-color: #FF5475; | ||
| border-color: #97B0F8; | ||
| z-index: auto; | ||
| } | ||
|
|
||
| .vis.timeline .item.stage.running { | ||
| background-color: #FDFFCA; | ||
| } | ||
|
|
||
| .vis.timeline .item.stage.running.selected { | ||
| background-color: #FDFFCA; | ||
| border-color: #97B0F8; | ||
| z-index: auto; | ||
| } | ||
|
|
||
| .vis.timeline .item.job { | ||
| cursor: pointer; | ||
| } | ||
|
|
||
| .vis.timeline .item.job.succeeded { | ||
| background-color: #D5DDF6; | ||
| } | ||
|
|
||
| .vis.timeline .item.job.succeeded.selected { | ||
| background-color: #D5DDF6; | ||
| border-color: #97B0F8; | ||
| z-index: auto; | ||
| } | ||
|
|
||
| .vis.timeline .item.job.failed { | ||
| background-color: #FF5475; | ||
| } | ||
|
|
||
| .vis.timeline .item.job.failed.selected { | ||
| background-color: #FF5475; | ||
| border-color: #97B0F8; | ||
| z-index: auto; | ||
| } | ||
|
|
||
| .vis.timeline .item.job.running { | ||
| background-color: #FDFFCA; | ||
| } | ||
|
|
||
| .vis.timeline .item.job.running.selected { | ||
| background-color: #FDFFCA; | ||
| border-color: #97B0F8; | ||
| z-index: auto; | ||
| } | ||
|
|
||
| .vis.timeline .item.executor.added { | ||
| background-color: #D5DDF6; | ||
| } | ||
|
|
||
| .vis.timeline .item.executor.removed { | ||
| background-color: #EBCA59; | ||
| } | ||
|
|
||
| .vis.timeline .item.executor.selected { | ||
| border-color: #FFC200; | ||
| background-color: #FFF785; | ||
| z-index: 2; | ||
| } | ||
|
|
||
| tr.corresponding-item-hover { | ||
| background: #FFE1FA !important; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,117 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| function drawApplicationTimeline(groupArray, eventObjArray, startTime) { | ||
| var groups = new vis.DataSet(groupArray); | ||
| var items = new vis.DataSet(eventObjArray); | ||
| var container = $("#application-timeline")[0]; | ||
| var options = { | ||
| groupOrder: function(a, b) { | ||
| return a.value - b.value | ||
| }, | ||
| editable: false, | ||
| showCurrentTime: false, | ||
| min: startTime, | ||
| zoomable: false | ||
| }; | ||
|
|
||
| var applicationTimeline = new vis.Timeline(container); | ||
| applicationTimeline.setOptions(options); | ||
| applicationTimeline.setGroups(groups); | ||
| applicationTimeline.setItems(items); | ||
|
|
||
| setupZoomable("#application-timeline-zoom-lock", applicationTimeline); | ||
|
|
||
| $(".item.range.job.application-timeline-object").each(function() { | ||
| var getJobId = function(baseElem) { | ||
| var jobIdText = $($(baseElem).find(".application-timeline-content")[0]).text(); | ||
| var jobId = "#job-" + jobIdText.match("\\(Job (\\d+)\\)")[1]; | ||
| return jobId; | ||
| } | ||
|
|
||
| $(this).click(function() { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be good to use javascript so there is a pointer when I mouse over the object.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, it would be nice if, when I mouse over, the border of the table cell gets thicker or is higlighted in some way.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've implemented tooltip using existing tooltip library. |
||
| window.location.href = getJobId(this); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After thinking about it more - I think this should link to the actual job page (since we have the highlighting now) rather than the job anchor on this page. |
||
| }); | ||
|
|
||
| $(this).hover( | ||
| function() { | ||
| $(getJobId(this)).addClass("corresponding-item-hover"); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This only seems to work for rows that are white background in the jobs table, not the rows that are gray background (I tried it locally with the UIWorkloadGenerator).
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks. I fixed this bug. |
||
| }, | ||
| function() { | ||
| $(getJobId(this)).removeClass("corresponding-item-hover"); | ||
| } | ||
| ); | ||
| }); | ||
| } | ||
|
|
||
| function drawJobTimeline(groupArray, eventObjArray, startTime) { | ||
| var groups = new vis.DataSet(groupArray); | ||
| var items = new vis.DataSet(eventObjArray); | ||
| var container = $('#job-timeline')[0]; | ||
| var options = { | ||
| groupOrder: function(a, b) { | ||
| return a.value - b.value; | ||
| }, | ||
| editable: false, | ||
| showCurrentTime: false, | ||
| min: startTime, | ||
| zoomable: false, | ||
| }; | ||
|
|
||
| var jobTimeline = new vis.Timeline(container); | ||
| jobTimeline.setOptions(options); | ||
| jobTimeline.setGroups(groups); | ||
| jobTimeline.setItems(items); | ||
|
|
||
| setupZoomable("#job-timeline-zoom-lock", jobTimeline); | ||
|
|
||
| $(".item.range.stage.job-timeline-object").each(function() { | ||
|
|
||
| var getStageId = function(baseElem) { | ||
| var stageIdText = $($(baseElem).find(".job-timeline-content")[0]).text(); | ||
| var stageId = "#stage-" + stageIdText.match("\\(Stage (\\d+\\.\\d+)\\)")[1].replace(".", "-"); | ||
| return stageId; | ||
| } | ||
|
|
||
| $(this).click(function() { | ||
| window.location.href = getStageId(this); | ||
| }); | ||
|
|
||
| $(this).hover( | ||
| function() { | ||
| $(getStageId(this)).addClass("corresponding-item-hover"); | ||
| }, | ||
| function() { | ||
| $(getStageId(this)).removeClass("corresponding-item-hover"); | ||
| } | ||
| ); | ||
| }); | ||
| } | ||
|
|
||
| function setupZoomable(id, timeline) { | ||
| $(id + '>input[type="checkbox"]').click(function() { | ||
| if (this.checked) { | ||
| timeline.setOptions({zoomable: false}); | ||
| } else { | ||
| timeline.setOptions({zoomable: true}); | ||
| } | ||
| }); | ||
|
|
||
| $(id + ">span").click(function() { | ||
| $(this).parent().find('input:checkbox').trigger('click'); | ||
| }); | ||
| } | ||
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make it so that when I hover over the element I get a tooltip that has the contents contained in the cell? I noticed the contents are not readable when they job is really short. We are already using a tooltip library in the library, so it should be possible to use the existing one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In current implementation, when you hover the element, title will appear and it has the contents (but not use the tooltip library).