Merge branch 'performance-tuning' of ssh://github.com/mozilla/treeherder-ui into performance-tuning

This commit is contained in:
Jonathan Eads 2014-02-21 17:15:36 -08:00
Родитель 62a8b888d3 b386111569
Коммит 89980aabee
3 изменённых файлов: 27 добавлений и 5 удалений

Просмотреть файл

@ -196,3 +196,14 @@ treeherder.provider('thEvents', function() {
};
});
/**
* Create a hash for a job based on the resultset id, platform name, and
* platform option
*/
treeherder.provider('thPlatformHash', function() {
this.$get = function() {
return function(job) {
return job.resultset_id + job.platform + job.platform_opt;
};
};
});

Просмотреть файл

@ -33,8 +33,8 @@ treeherder.factory('thResultSets',
}]);
treeherder.factory('thResultSetModel',
['$log', '$rootScope', 'thResultSets', 'thSocket', 'thJobs', 'thEvents',
function($log, $rootScope, thResultSets, thSocket, thJobs, thEvents) {
['$log', '$rootScope', 'thResultSets', 'thSocket', 'thJobs', 'thEvents', 'thPlatformHash',
function($log, $rootScope, thResultSets, thSocket, thJobs, thEvents, thPlatformHash) {
/******
* Handle updating the resultset datamodel based on a queue of jobs
@ -363,8 +363,19 @@ treeherder.factory('thResultSetModel',
*/
var updateJobs = function(jobList) {
$log.debug("number of jobs returned for add/update: " + jobList.length);
jobList.forEach(updateJob);
$rootScope.$broadcast(thEvents.jobsLoaded, jobList);
var platformHashes = [];
for (var i = 0; i < jobList.length; i++) {
updateJob(jobList[i]);
var ph = thPlatformHash(jobList[i]);
if (platformHashes.indexof(ph) < 0) {
platformHashes.push(ph);
}
}
// coalesce the updated jobs into their
$rootScope.$broadcast(thEvents.jobsLoaded, platformHashes, jobList);
};
/******

Просмотреть файл

@ -3,7 +3,7 @@
<div class="progress-bar" role="progressbar" style="width: 100%"></div>
</div>
<div ng-repeat="resultset in result_sets track by resultset.id | orderBy:'-push_timestamp'"
<div ng-repeat="resultset in result_sets track by resultset.id | orderBy:'-push_timestamp'"
ng-controller="ResultSetCtrl"
class="result-set col col-xs-12"
data-id="{{resultset.id}}">