Permalink
Browse files

fixed b2g issues, started inline metrics calculations

  • Loading branch information...
1 parent bb7a009 commit 59ec1954a1050c1b2fa7621d3a94370ceef77e35 @jeads jeads committed Mar 22, 2013
View
@@ -1121,6 +1121,46 @@ def get_application_log(self, revision):
return log
+ def compute_inline_metrics(self, data):
+
+ product = data['test_build']['name']
+ branch = data['test_build']['branch']
+ branch_version = data['test_build']['version']
+ operating_system_name = data['test_build']['name']
+ operating_system_version = data['test_machine']['osversion']
+ processor = data['test_machine']['platform']
+ test_name = data['testrun']['suite']
+
+ pages = data['results'].keys()
+
+ product_iter = self.sources["perftest"].dhub.execute(
+ proc='perftest.selects.get_product_id',
+ debug_show=self.DEBUG,
+ placeholders=[product, branch, branch_version],
+ return_type='iter',
+ )
+ product_id = product_iter.get_column_data('id')
+
+ os_iter = self.sources["perftest"].dhub.execute(
+ proc='perftest.selects.get_os_id',
+ debug_show=self.DEBUG,
+ placeholders=[operating_system_name, operating_system_version],
+ return_type='iter',
+ )
+ os_id = os_iter.get_column_data('id')
+
+ test_iter = self.sources["perftest"].dhub.execute(
+ proc='perftest.selects.get_test_id',
+ debug_show=self.DEBUG,
+ placeholders=[test_name, 1],
+ return_type='iter',
+ )
+ test_id = os_iter.get_column_data('id')
+
+ ##Get the relevant ids##
+
+ ##TODO: Finish this function or remove it
+
def _get_metric_collection(self):
proc = 'perftest.selects.get_metric_collection'
@@ -1689,6 +1729,7 @@ def get_metric_value(self, metric_value_name, ref_data, result):
else:
return value
+
def _get_summary_data_lookup(self, data):
lookup = {}
@@ -89,25 +89,25 @@ var AppsPage = new Class( {
lookup['test'] = test;
}
- var app = $(view.appNameSpanSel).text();
- if(app != ""){
- params.push('app=' + app);
- lookup['app'] = app;
- }
-
var appListEls = $(view.appSeriesSel).find("input:checkbox:checked");
var appList = [];
_.map(appListEls, function(el){
appList.push( $(el).next().text() );
});
-
if(appList.length > 0){
params.push('app_list=' + appList.join(','));
}
//Always store the app_list lookup so we can represent
//0 selected apps in the app_list
lookup['app_list'] = appList;
+ var app = $(view.appNameSpanSel).text();
+ if( (app != "") && (appList.length > 0)){
+ params.push('app=' + app);
+ lookup['app'] = app;
+ }
+
+
var gaiaRev = $(view.gaiaRevisionSel).text();
if(gaiaRev != ""){
params.push('gaia_rev=' + gaiaRev);
@@ -143,11 +143,12 @@ var AppsPage = new Class( {
}
this.urlBase = urlObj.attr.base + urlObj.attr.directory;
+this.urlBase = 'https://datazilla.mozilla.org/b2g/';
this.defaults = {};
this.defaults['branch'] = urlObj.param.query.branch;
this.defaults['range'] = urlObj.param.query.range;
- this.defaults['test'] = urlObj.param.query.test;
+ this.defaults['test'] = urlObj.param.query.test || 'cold_load_time';
this.defaults['app'] = urlObj.param.query.app;
if( urlObj.param.query.app_list != undefined ){
@@ -344,6 +344,16 @@ var GraphControlsView = new Class({
//added to history
APPS_PAGE.disableSaveState = true;
+ //Use the change event to synchronize saving state to after
+ //the last checkbox is selected
+ $(inputEls[ inputEls.length-1 ]).unbind('change');
+ $(inputEls[ inputEls.length-1 ]).bind('change', function(event){
+ //Reenable saveState
+ APPS_PAGE.disableSaveState = false;
+ //Save the new application selection state
+ APPS_PAGE.saveState(true);
+ });
+
for(var i=0; i<inputEls.length; i++){
var el = inputEls[i];
@@ -352,7 +362,6 @@ var GraphControlsView = new Class({
if( !$(el).is(':checked') ){
$(el).click();
- appName = $(el).next().text();
}
}else {
@@ -364,11 +373,6 @@ var GraphControlsView = new Class({
}
}
- //Reenable saveState
- APPS_PAGE.disableSaveState = false;
-
- //Save the new application selection state
- APPS_PAGE.saveState();
},
selectApplications: function(testIds){
@@ -116,7 +116,8 @@ var PerformanceGraphComponent = new Class({
}
- if(!_.isEmpty(this.data) && (this.testToggled === true)){
+ //if(!_.isEmpty(this.data) && (this.testToggled === true)){
+ if(!_.isEmpty(this.data)){
this.renderPlot(this.data);
}
@@ -207,7 +208,6 @@ var PerformanceGraphComponent = new Class({
);
}
-
var chart = [];
var testIds = _.keys(this.chartData);
@@ -234,7 +234,7 @@ var PerformanceGraphComponent = new Class({
}
//Only display app names that are found in the dataset
- APPS_PAGE.graphControlsComponent.displayApps(appNames);
+ APPS_PAGE.graphControlsComponent.displayApps(appNames, this.testToggled);
this.view.showData(_.isEmpty(this.data));
@@ -275,6 +275,7 @@ var PerformanceGraphComponent = new Class({
}else {
APPS_PAGE.saveState();
}
+
},
stateChange: function(event, data){
View
@@ -1,6 +1,6 @@
# Pure-python dependencies; pre-installed in vendor/
-Django==1.3.1
+Django==1.4.4
python-memcached==1.48
oauth2==1.5.211
httplib2==0.7.4

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -1,3 +1,6 @@
+import json
+import os
+
from datazilla.model.base import TestData
from ..sample_data import perftest_data
@@ -51,5 +54,3 @@ def test_ttest_nan():
else:
raise Exception('Failed to raise MetricMethodError')
-
-
@@ -1,4 +1,5 @@
import json
+import os
import datetime
import copy
import urllib
@@ -788,6 +789,18 @@ def mock_urlopen(nuttin_honey):
return setup_data
+def test_compute_inline_metrics(mtm):
+
+ sample_data_path = os.path.dirname(__file__) + '/sample_data/tp5o.json'
+ sample_json = ""
+
+ with open(sample_data_path) as f:
+ sample_json = json.loads( f.read() )
+
+ for data in sample_json:
+
+ mtm.compute_inline_metrics(data)
+
def _adapt_data(mtm, data):
adapted_reference = {}

0 comments on commit 59ec195

Please sign in to comment.