Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

made changes

  • Loading branch information...
commit 62ae872faa685991021f0d6c4d4020480e440e54 1 parent 212712d
@jeads jeads authored
View
10 datazilla/webapp/apps/datazilla/testdata/views.py
@@ -121,6 +121,10 @@ def get_metrics_pushlog(request, project, branch, revision):
except ValueError:
pass
+ #applies to both before/after, so total of 2*maximum_pushes
+ #are allowed
+ maximum_pushes = 1000
+
pushes_before = 10
try:
pushes_before = int(request.GET.get("pushes_before", 10))
@@ -133,6 +137,12 @@ def get_metrics_pushlog(request, project, branch, revision):
except ValueError:
pass
+ #Set maximum limit for pushes before/after
+ if pushes_before > maximum_pushes:
+ pushes_before = maximum_pushes
+ if pushes_after > maximum_pushes:
+ pushes_after = maximum_pushes
+
numdays = 0
try:
numdays = int(request.GET.get("numdays", 0))
View
5 datazilla/webapp/static/css/summary.css
@@ -50,6 +50,11 @@ div.su-spinner {
background: transparent url(/static/images/spinner.gif) no-repeat center center;
height:280px;
}
+div.su-small-spinner {
+ background: transparent url(/static/images/spinner.gif) no-repeat center center;
+ height:35px;
+ width:35px;
+}
.su-scroll-panel {
overflow-y: auto;
height:200px;
View
35 datazilla/webapp/static/js/metric_summary/TestPagesComponent.js
@@ -52,6 +52,12 @@ var TestPagesView = new Class({
this.failBackgroundColor = 'su-fail-background-color';
this.passBackgroundColor = 'su-pass-background-color';
+ //This is used to store the row to initialize the
+ //push log with. It's set by _adaptData to the first
+ //row in the first table loaded.
+ this.defaultRowCbSel = "";
+ this.defaultRowSelectionSent = false;
+
this.cbIdPrefix = 'su_cb_';
this.scrollHeight = parseInt($(this.tableContainerSel).css('height')) - 125;
@@ -64,6 +70,7 @@ var TestPagesView = new Class({
this.gridClickEvent = 'GRID_CLICK_EVENT';
this.gridMouseoverEvent = 'GRID_MOUSEOVER_EVENT';
this.closeDataSeriesEvent = 'CLOSE_DATA_SERIES_EVENT';
+ this.defaultRowSelectionEvent = 'DEFAULT_ROW_SELECTION_EVENT';
$(this.eventContainerSel).bind(
this.gridMouseoverEvent,
@@ -80,8 +87,8 @@ var TestPagesView = new Class({
_.bind(this.uncheckCb, this)
);
- $(this.tableSel).live(
- 'click mouseover', _.bind(this.tableEventHandler, this)
+ $(this.tableSel).bind(
+ 'click', _.bind(this.tableEventHandler, this)
);
},
@@ -130,10 +137,21 @@ var TestPagesView = new Class({
'aaSorting':[ [2, 'asc'] ]
};
+
this._adaptData(datatableOptions, eventData.data);
this.dataTable = $(this.tableSel).dataTable( datatableOptions );
+ //Send default row event out
+ if(this.defaultRowSelectionSent === false){
+
+ $(this.eventContainerSel).trigger(
+ this.defaultRowSelectionEvent, this.defaultRowCbSel
+ );
+
+ this.defaultRowSelectionSent = true;
+ }
+
},
lockTable: function(event, eventData){
$(this.lockTableSel).click();
@@ -144,14 +162,7 @@ var TestPagesView = new Class({
},
tableEventHandler: function(event){
- if(event.type == 'mouseover'){
-
- var target = $(event.target);
- var elParent = $(target).parent();
-
- var highlightClass = "";
-
- }else if(event.type == 'click'){
+ if(event.type == 'click'){
if( $(event.target).is('input') ){
@@ -192,6 +203,10 @@ var TestPagesView = new Class({
var key = this.cbIdPrefix + MS_PAGE.getDatumKey(keyData);
+ if( (i === 0) && (this.defaultRowCbSel === "")){
+ this.defaultRowCbSel = '#' + key;
+ }
+
//page name
var row = {};
row['0'] = '<input id="' + key +
View
81 datazilla/webapp/static/js/metric_summary/TrendLineComponent.js
@@ -41,6 +41,17 @@ var TrendLineComponent = new Class({
this.pushesBefore = 50;
this.pushesAfter = 3;
+ //true indicates push retrieval in progress
+ //false indicates more pushes can be retrieved
+ this.getPushState = false;
+
+ //The first simulated table checkbox click will
+ //not have the eventData.checked attribute set. This
+ //switch allows initializeTrend to fully process the
+ //event anyway. Not sure why the .click() function
+ //does not take care of this.
+ this.simulatedTableCBClick = false;
+
this.plot = undefined;
this.chartOptions = {
@@ -66,6 +77,7 @@ var TrendLineComponent = new Class({
this.tableInputClickEvent = 'TABLE_CLICK_EVENT';
this.closeDataSeriesEvent = 'CLOSE_DATA_SERIES_EVENT';
+ this.defaultRowSelectionEvent = 'DEFAULT_ROW_SELECTION_EVENT';
$(this.view.chartContainerSel).bind(
'plotclick', _.bind(this._clickPlot, this));
@@ -95,11 +107,24 @@ var TrendLineComponent = new Class({
$(this.view.pushesAfterSel).bind(
'keyup', _.bind(this._handlePushAroundInput, this)
);
+
+ //Simulate click on the default test suite table row
+ $(this.view.eventContainerSel).bind(
+ this.defaultRowSelectionEvent,
+ _.bind(this.clickTableCB, this)
+ );
+ },
+ clickTableCB: function(event, eventData){
+ this.simulatedTableCBClick = true;
+ $(eventData).click();
},
initializeTrend: function(event, eventData){
- if( eventData.checked ){
+ if(this.simulatedTableCBClick){
+ eventData.checked = 'checked';
+ }
+ if( eventData.checked ){
//Load trend line
var key = MS_PAGE.getDatumKey(eventData);
@@ -107,6 +132,8 @@ var TrendLineComponent = new Class({
var pushCounts = this.view.getPushCounts();
+ this.setGetPushState();
+
this.model.getTrendLine(
this, this.loadTrendData, this.dataLoadError, eventData,
pushCounts.before, pushCounts.after
@@ -122,10 +149,13 @@ var TrendLineComponent = new Class({
var pushCounts = this.view.getPushCounts();
+
for(var i=0; i<this.trendLineOrder.length; i++){
var key = this.trendLineOrder[i];
+ this.setGetPushState();
+
//Build the eventData data structure
//for each trend line
var trendLineEventData = {};
@@ -140,6 +170,14 @@ var TrendLineComponent = new Class({
);
}
},
+ setGetPushState: function(){
+ this.getPushState = true;
+ this.view.setGetPushState();
+ },
+ unsetGetPushState: function(){
+ this.getPushState = false;
+ this.view.unsetGetPushState();
+ },
loadTrendData: function(data, response, eventData){
data = this._loadMockData(data, eventData);
@@ -252,6 +290,15 @@ var TrendLineComponent = new Class({
this.view.drawCircleAroundDataPoints(targetRevisions, this.plot);
+ this.unsetGetPushState();
+ this.view.displayDashboard();
+
+ if(this.simulatedTableCBClick === false){
+ //var datum = this.trendLines[key]['data'][ item.datapoint[0] ];
+ //var key = this.seriesIndexToKey[item.seriesIndex][item.dataIndex];
+ //_hoverPlot: function(event, pos, item){
+ this.simulatedTableCBClick = true;
+ }
},
getFailDataset: function(){
return {
@@ -300,7 +347,7 @@ var TrendLineComponent = new Class({
return n;
},
formatLabel: function(label, series){
- return this.tickDisplayDates[label];
+ return this.tickDisplayDates[label] || "";
},
closeDataSeries: function(event){
@@ -364,8 +411,11 @@ var TrendLineComponent = new Class({
},
_handlePushAroundInput: function(event){
if(event.keyCode === 13){
- this.getPushes();
+ if(this.getPushState === false){
+ this.getPushes();
+ }
} else {
+ //Prevent user from entering anything other than an integer
var v = $(event.target).val();
var integersEntered = parseInt(v);
$(event.target).val(integersEntered || "");
@@ -387,7 +437,6 @@ var TrendLineComponent = new Class({
_hoverPlot: function(event, pos, item){
if(item){
-
//Check if the datum display is locked
var checked = $(this.view.datumLockSel).attr('checked');
if(checked){
@@ -572,6 +621,9 @@ var TrendLineView = new Class({
this.parent(options);
+ this.pushlogSpinnerSel = '#su_pushlog_spinner';
+ this.pushlogDashboardSel = '#su_pushlog_dashboard';
+
this.eventContainerSel = '#su_container';
this.chartContainerSel = '#su_trendline_plot';
this.detailContainerOneSel = '#su_graph_detail_container_1';
@@ -579,6 +631,7 @@ var TrendLineView = new Class({
this.pushesBeforeSel = '#su_pushes_before';
this.pushesAfterSel = '#su_pushes_after';
+ this.getPushSpinnerSel = '#su_get_pushes_spinner';
this.datumRevision = '#su_datum_revision';
this.datumRawDataAnchor = '#su_raw_data';
@@ -587,7 +640,8 @@ var TrendLineView = new Class({
this.datumDisplayContainers = [
this.datumRevision, this.datumControls,
- this.detailContainerTwoSel ];
+ this.detailContainerTwoSel
+ ];
this.datasetLegendSel = '#su_legend';
this.datasetTitleName = 'su_dataset_title';
@@ -604,8 +658,25 @@ var TrendLineView = new Class({
this.getPushesSel = '#su_get_pushes';
$(this.getPushesSel).button();
+ this.dashboardDisplayed = false;
},
+ displayDashboard: function(){
+ if(this.dashboardDisplayed === false){
+ $(this.pushlogSpinnerSel).css('display', 'none');
+ $(this.pushlogDashboardSel).css('display', 'block');
+ }
+ },
+ setGetPushState: function(){
+
+ $(this.getPushesSel).button({ "disabled": true });
+ $(this.getPushSpinnerSel).css('display', 'block');
+ },
+ unsetGetPushState: function(){
+
+ $(this.getPushesSel).button({ "disabled": false });
+ $(this.getPushSpinnerSel).css('display', 'none');
+ },
drawCircleAroundDataPoints: function(targetRevisions, plot){
var ctx = plot.getCanvas().getContext("2d");
View
33 datazilla/webapp/templates/metrics.summary.html
@@ -89,18 +89,29 @@
</div>
</div>
</div>
- <div style="height:475px;" class="ui-widget ui-widget-header ui-corner-all dv-toolpanel su-panel-base">
- <h2 style="margin-left:185px;">Revision Pushlog</h2>
- <div style="margin-left:185px; margin-bottom:3px;">Pushes Around <span id="su_pushes_around_rev"></span>: before<input id="su_pushes_before" type="text" size="3" maxlength="3" style="margin-left:3px; margin-right:5px;"/>after:<input id="su_pushes_after" type="text" size="3" maxlength="3" style="margin-left:3px; margin-right:3px;"/><button id="su_get_pushes" style="margin-left:8px;">Get Pushes</button></div>
- <div id="su_graph_detail_container_1" class="ui-widget css-left" style="width:135px; overflow-y:auto; height:380px; display:block;"></div>
- <div class="su-vertical-text">Mean (milliseconds)</div>
- <div id="su_trendline_plot" style="margin-left:30px; margin-bottom:10px; float:left; height:350px; width:600px;"></div>
- <div style="overflow-y: auto; height: 380px; display: block; float:right; width:200px;">
- <div id="su_datum_revision" style="width:181px;" class="ui-state-highlight ui-corner-all su-data-series-panel css-right su-large-text">REVISION</div>
- <div id="su_datum_controls" style="width:185px;" class="ui-state-highlight ui-corner-all su-data-series-panel css-right su-light-text">Lock Push:<input id="su_lock_datum" type="checkbox" /><div style="float:right;"><a id="su_raw_data" target="_blank" href="#">Get Raw Data</a></div></div>
- <div id="su_graph_detail_container_2" style="width:185px; margin-left:5px;" class="ui-state-highlight ui-corner-all su-data-series-panel css-right"></div>
+ <div style="height:500px;" class="ui-widget ui-widget-header ui-corner-all dv-toolpanel su-panel-base">
+
+ <div id="su_pushlog_spinner" style="height:400px;" class="su-spinner ui-widget"></div>
+
+ <div id="su_pushlog_dashboard" style="display:none;">
+
+ <h2 style="margin-left:185px;">Revision Pushlog</h2>
+
+ <div style="margin-left:185px; margin-bottom:50px;"><div style="float:left; margin-top:5px;" >Pushes Around <span id="su_pushes_around_rev"></span>: before<input id="su_pushes_before" type="text" size="3" maxlength="3" style="margin-left:3px; margin-right:5px;"/>after:<input id="su_pushes_after" type="text" size="3" maxlength="3" style="margin-left:3px; margin-right:3px;"/></div><button id="su_get_pushes" style="float:left; margin-left:8px; margin-top:3px;">Get Pushes</button><div id="su_get_pushes_spinner" style="float:left; margin-left:3px; display:none;" class="su-small-spinner"></div></div>
+
+ <div class="ui-helper-clearfix"></div>
+
+ <div id="su_graph_detail_container_1" class="ui-widget css-left" style="width:135px; overflow-y:auto; height:380px; display:block;"></div>
+ <div class="su-vertical-text">Mean (milliseconds)</div>
+ <div id="su_trendline_plot" style="margin-left:30px; margin-bottom:20px; float:left; height:350px; width:600px;"></div>
+ <div style="overflow-y: auto; height: 380px; display: block; float:right; width:200px;">
+ <div id="su_datum_revision" style="width:181px;" class="ui-state-highlight ui-corner-all su-data-series-panel css-right su-large-text">REVISION</div>
+ <div id="su_datum_controls" style="width:185px;" class="ui-state-highlight ui-corner-all su-data-series-panel css-right su-light-text">Lock Push:<input id="su_lock_datum" type="checkbox" /><div style="float:right;"><a id="su_raw_data" target="_blank" href="#">Get Raw Data</a></div></div>
+ <div id="su_graph_detail_container_2" style="width:185px; margin-left:5px;" class="ui-state-highlight ui-corner-all su-data-series-panel css-right"></div>
+ </div>
+ <div class="ui-helper-clearfix"></div>
+ <div style="margin-left:185px; margin-bottom:3px;">Repository (hg.mozilla.org) Push Range: begin<input type="text" size="12" style="margin-left:3px; margin-right:5px;"/>end:<input type="text" size="12" style="margin-left:3px; margin-right:3px;"/><button id="su_get_range" style="margin-left:8px;">Get Range</button></div>
</div>
- <div style="margin-left:185px; margin-bottom:3px; margin-top:10px;">Repository (hg.mozilla.org) Push Range: begin<input type="text" size="12" style="margin-left:3px; margin-right:5px;"/>end:<input type="text" size="12" style="margin-left:3px; margin-right:3px;"/><button id="su_get_range" style="margin-left:8px;">Get Range</button></div>
</div>
</div> <!-- End su_container -->
Please sign in to comment.
Something went wrong with that request. Please try again.