aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/resources/org
diff options
context:
space:
mode:
authorKay Ousterhout <kayousterhout@gmail.com>2015-05-15 17:45:14 -0700
committerKay Ousterhout <kayousterhout@gmail.com>2015-05-15 17:45:14 -0700
commite74545647684b3047248ca3cfee894ac5378dead (patch)
treee49d7b37c311ac8aca915e5935c2b9262d651449 /core/src/main/resources/org
parentc8696337e2a5878f3171eb574c0a1365d45814c9 (diff)
downloadspark-e74545647684b3047248ca3cfee894ac5378dead.tar.gz
spark-e74545647684b3047248ca3cfee894ac5378dead.tar.bz2
spark-e74545647684b3047248ca3cfee894ac5378dead.zip
[SPARK-7676] Bug fix and cleanup of stage timeline view
cc pwendell sarutak This commit cleans up some unnecessary code, eliminates the feature where when you mouse-over a box in the timeline, the corresponding task is highlighted in the table (because that feature is only useful in the rare case when you have a very small number of tasks, in which case it's easy to figure out the mapping anyway), and fixes a bug where nothing shows up if you try to visualize a stage with only 1 task. Author: Kay Ousterhout <kayousterhout@gmail.com> Closes #6202 from kayousterhout/SPARK-7676 and squashes the following commits: dfd29d4 [Kay Ousterhout] [SPARK-7676] Bug fix and cleanup of stage timeline view
Diffstat (limited to 'core/src/main/resources/org')
-rw-r--r--core/src/main/resources/org/apache/spark/ui/static/timeline-view.js48
1 files changed, 16 insertions, 32 deletions
diff --git a/core/src/main/resources/org/apache/spark/ui/static/timeline-view.js b/core/src/main/resources/org/apache/spark/ui/static/timeline-view.js
index e1150359bc..604c299941 100644
--- a/core/src/main/resources/org/apache/spark/ui/static/timeline-view.js
+++ b/core/src/main/resources/org/apache/spark/ui/static/timeline-view.js
@@ -133,7 +133,7 @@ function drawJobTimeline(groupArray, eventObjArray, startTime) {
});
}
-function drawTaskAssignmentTimeline(groupArray, eventObjArray, minLaunchTime, zoomMax) {
+function drawTaskAssignmentTimeline(groupArray, eventObjArray, minLaunchTime, maxFinishTime) {
var groups = new vis.DataSet(groupArray);
var items = new vis.DataSet(eventObjArray);
var container = $("#task-assignment-timeline")[0]
@@ -146,8 +146,8 @@ function drawTaskAssignmentTimeline(groupArray, eventObjArray, minLaunchTime, zo
selectable: false,
showCurrentTime: false,
min: minLaunchTime,
- zoomable: false,
- zoomMax: zoomMax
+ max: maxFinishTime,
+ zoomable: false
};
var taskTimeline = new vis.Timeline(container)
@@ -155,48 +155,32 @@ function drawTaskAssignmentTimeline(groupArray, eventObjArray, minLaunchTime, zo
taskTimeline.setGroups(groups);
taskTimeline.setItems(items);
- taskTimeline.on("rangechange", function(prop) {
- if (currentDisplayedTooltip !== null) {
- $(currentDisplayedTooltip).tooltip("hide");
- }
- });
-
- function getTaskIdxAndAttempt(selector) {
- var taskIdxText = $(selector).attr("data-title");
- var taskIdxAndAttempt = taskIdxText.match("Task (\\d+) \\(attempt (\\d+)");
- var taskIdx = taskIdxAndAttempt[1];
- var taskAttempt = taskIdxAndAttempt[2];
- return taskIdx + "-" + taskAttempt;
- }
-
- // If we zoom up and a box moves away when the corresponding tooltip is shown,
- // the tooltip can be remain.
- // So, we need to hide tooltips using another mechanism.
+ // If a user zooms while a tooltip is displayed, the user may zoom such that the cursor is no
+ // longer over the task that the tooltip corresponds to. So, when a user zooms, we should hide
+ // any currently displayed tooltips.
var currentDisplayedTooltip = null;
-
$("#task-assignment-timeline").on({
"mouseenter": function() {
- var taskIdxAndAttempt = getTaskIdxAndAttempt(this);
- $("#task-" + taskIdxAndAttempt).addClass("corresponding-item-hover");
- $(this).tooltip("show");
currentDisplayedTooltip = this;
},
- "mouseleave" : function() {
- var taskIdxAndAttempt = getTaskIdxAndAttempt(this);
- $("#task-" + taskIdxAndAttempt).removeClass("corresponding-item-hover");
- $(this).tooltip("hide");
+ "mouseleave": function() {
currentDisplayedTooltip = null;
}
}, ".task-assignment-timeline-content");
+ taskTimeline.on("rangechange", function(prop) {
+ if (currentDisplayedTooltip !== null) {
+ $(currentDisplayedTooltip).tooltip("hide");
+ }
+ });
- setupZoomable('#task-assignment-timeline-zoom-lock', taskTimeline);
+ setupZoomable("#task-assignment-timeline-zoom-lock", taskTimeline);
$("span.expand-task-assignment-timeline").click(function() {
- $("#task-assignment-timeline").toggleClass('collapsed');
+ $("#task-assignment-timeline").toggleClass("collapsed");
// Switch the class of the arrow from open to closed.
- $(this).find('.expand-task-assignment-timeline-arrow').toggleClass('arrow-open');
- $(this).find('.expand-task-assignment-timeline-arrow').toggleClass('arrow-closed');
+ $(this).find(".expand-task-assignment-timeline-arrow").toggleClass("arrow-open");
+ $(this).find(".expand-task-assignment-timeline-arrow").toggleClass("arrow-closed");
});
}