Skip to content

Commit

Permalink
Merge branch 'master' into SPARK-6939
Browse files Browse the repository at this point in the history
  • Loading branch information
zsxwing committed May 1, 2015
2 parents 70d8533 + 7630213 commit 2586916
Show file tree
Hide file tree
Showing 149 changed files with 5,350 additions and 981 deletions.
3 changes: 3 additions & 0 deletions .rat-excludes
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ bootstrap-tooltip.js
jquery-1.11.1.min.js
sorttable.js
d3.min.js
vis.min.js
vis.min.css
vis.map
.*avsc
.*txt
.*json
Expand Down
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,7 @@ BSD-style licenses
The following components are provided under a BSD-style license. See project link for details.

(BSD 3 Clause) core (com.github.fommil.netlib:core:1.1.2 - https://github.com/fommil/netlib-java/core)
(BSD 3 Clause) JPMML-Model (org.jpmml:pmml-model:1.1.15 - https://github.com/jpmml/jpmml-model)
(BSD 3-clause style license) jblas (org.jblas:jblas:1.2.3 - http://jblas.org/)
(BSD License) AntLR Parser Generator (antlr:antlr:2.7.7 - http://www.antlr.org/)
(BSD License) Javolution (javolution:javolution:5.5.1 - http://javolution.org)
Expand Down
182 changes: 182 additions & 0 deletions core/src/main/resources/org/apache/spark/ui/static/timeline-view.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
/*
* 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: 5px;
}

.vis.timeline div.content {
width: 100%;
}

.vis.timeline .item.stage {
cursor: pointer;
}

.vis.timeline .item.stage.succeeded {
background-color: #D5DDF6;
}

.vis.timeline .item.stage.succeeded.selected {
background-color: #D5DDF6;
border-color: #97B0F8;
z-index: auto;
}

.legend-area rect.completed-stage-legend {
fill: #D5DDF6;
stroke: #97B0F8;
}

.vis.timeline .item.stage.failed {
background-color: #FF5475;
}

.vis.timeline .item.stage.failed.selected {
background-color: #FF5475;
border-color: #97B0F8;
z-index: auto;
}

.legend-area rect.failed-stage-legend {
fill: #FF5475;
stroke: #97B0F8;
}

.vis.timeline .item.stage.running {
background-color: #FDFFCA;
}

.vis.timeline .item.stage.running.selected {
background-color: #FDFFCA;
border-color: #97B0F8;
z-index: auto;
}

.legend-area rect.active-stage-legend {
fill: #FDFFCA;
stroke: #97B0F8;
}

.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;
}

.legend-area rect.succeeded-job-legend {
fill: #D5DDF6;
stroke: #97B0F8;
}

.vis.timeline .item.job.failed {
background-color: #FF5475;
}

.vis.timeline .item.job.failed.selected {
background-color: #FF5475;
border-color: #97B0F8;
z-index: auto;
}

.legend-area rect.failed-job-legend {
fill: #FF5475;
stroke: #97B0F8;
}

.vis.timeline .item.job.running {
background-color: #FDFFCA;
}

.vis.timeline .item.job.running.selected {
background-color: #FDFFCA;
border-color: #97B0F8;
z-index: auto;
}

.legend-area rect.running-job-legend {
fill: #FDFFCA;
stroke: #97B0F8;
}

.vis.timeline .item.executor.added {
background-color: #D5DDF6;
}

.legend-area rect.executor-added-legend {
fill: #D5DDF6;
stroke: #97B0F8;
}

.vis.timeline .item.executor.removed {
background-color: #EBCA59;
}

.legend-area rect.executor-removed-legend {
fill: #EBCA59;
stroke: #97B0F8;
}

.vis.timeline .item.executor.selected {
border-color: #FFC200;
background-color: #FFF785;
z-index: 2;
}

tr.corresponding-item-hover>td, tr.corresponding-item-hover>th {
background-color: #FFE1FA !important;
}

#application-timeline.collapsed {
display: none;
}

#job-timeline.collapsed {
display: none;
}

.control-panel {
margin-bottom: 5px;
}

span.expand-application-timeline, span.expand-job-timeline {
cursor: pointer;
}

.control-panel input+span {
cursor: pointer;
}

.vis.timeline .item.range .content {
position: unset;
}

.vis.timeline .item .tooltip-inner {
max-width: unset !important;
}
168 changes: 168 additions & 0 deletions core/src/main/resources/org/apache/spark/ui/static/timeline-view.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
/*
* 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);
setupExecutorEventAction();

function setupJobEventAction() {
$(".item.range.job.application-timeline-object").each(function() {
var getJobId = function(baseElem) {
var jobIdText = $($(baseElem).find(".application-timeline-content")[0]).text();
var jobId = jobIdText.match("\\(Job (\\d+)\\)")[1];
return jobId;
};

$(this).click(function() {
window.location.href = "job/?id=" + getJobId(this);
});

$(this).hover(
function() {
$("#job-" + getJobId(this)).addClass("corresponding-item-hover");
$($(this).find("div.application-timeline-content")[0]).tooltip("show");
},
function() {
$("#job-" + getJobId(this)).removeClass("corresponding-item-hover");
$($(this).find("div.application-timeline-content")[0]).tooltip("hide");
}
);
});
}

setupJobEventAction();

$("span.expand-application-timeline").click(function() {
$("#application-timeline").toggleClass('collapsed');

// Switch the class of the arrow from open to closed.
$(this).find('.expand-application-timeline-arrow').toggleClass('arrow-open');
$(this).find('.expand-application-timeline-arrow').toggleClass('arrow-closed');
});
}

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);
setupExecutorEventAction();

function setupStageEventAction() {
$(".item.range.stage.job-timeline-object").each(function() {
var getStageIdAndAttempt = function(baseElem) {
var stageIdText = $($(baseElem).find(".job-timeline-content")[0]).text();
var stageIdAndAttempt = stageIdText.match("\\(Stage (\\d+\\.\\d+)\\)")[1].split(".");
return stageIdAndAttempt;
};

$(this).click(function() {
var idAndAttempt = getStageIdAndAttempt(this);
var id = idAndAttempt[0];
var attempt = idAndAttempt[1];
window.location.href = "../../stages/stage/?id=" + id + "&attempt=" + attempt;
});

$(this).hover(
function() {
var idAndAttempt = getStageIdAndAttempt(this);
var id = idAndAttempt[0];
var attempt = idAndAttempt[1];
$("#stage-" + id + "-" + attempt).addClass("corresponding-item-hover");
$($(this).find("div.job-timeline-content")[0]).tooltip("show");
},
function() {
var idAndAttempt = getStageIdAndAttempt(this);
var id = idAndAttempt[0];
var attempt = idAndAttempt[1];
$("#stage-" + id + "-" + attempt).removeClass("corresponding-item-hover");
$($(this).find("div.job-timeline-content")[0]).tooltip("hide");
}
);
});
}

setupStageEventAction();

$("span.expand-job-timeline").click(function() {
$("#job-timeline").toggleClass('collapsed');

// Switch the class of the arrow from open to closed.
$(this).find('.expand-job-timeline-arrow').toggleClass('arrow-open');
$(this).find('.expand-job-timeline-arrow').toggleClass('arrow-closed');
});
}

function setupExecutorEventAction() {
$(".item.box.executor").each(function () {
$(this).hover(
function() {
$($(this).find(".executor-event-content")[0]).tooltip("show");
},
function() {
$($(this).find(".executor-event-content")[0]).tooltip("hide");
}
);
});
}

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');
});
}
1 change: 1 addition & 0 deletions core/src/main/resources/org/apache/spark/ui/static/vis.map

Large diffs are not rendered by default.

Loading

0 comments on commit 2586916

Please sign in to comment.