Skip to content

Commit

Permalink
Bug 1151337 Perfherder graphs should use OptionCollectionModel
Browse files Browse the repository at this point in the history
  • Loading branch information
git-srinivas committed Apr 15, 2015
1 parent ff589ff commit 8732565
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
18 changes: 10 additions & 8 deletions ui/js/perf.js
Expand Up @@ -30,9 +30,9 @@ perf.factory('getSeriesSummary', [ function() {
}]);

perf.controller('PerfCtrl', [ '$state', '$stateParams', '$scope', '$rootScope', '$location',
'$modal', 'thServiceDomain', '$http', '$q', '$timeout', 'getSeriesSummary',
'$modal', 'thServiceDomain', '$http', '$q', '$timeout', 'getSeriesSummary', 'ThOptionCollectionModel',
function PerfCtrl($state, $stateParams, $scope, $rootScope, $location, $modal,
thServiceDomain, $http, $q, $timeout, getSeriesSummary) {
thServiceDomain, $http, $q, $timeout, getSeriesSummary, ThOptionCollectionModel) {

var availableColors = [ 'red', 'green', 'blue', 'orange', 'purple' ];

Expand Down Expand Up @@ -650,12 +650,14 @@ perf.controller('PerfCtrl', [ '$state', '$stateParams', '$scope', '$rootScope',

var optionCollectionMap = {};

$http.get(thServiceDomain + '/api/optioncollectionhash').then(
function(response) {
response.data.forEach(function(dict) {
optionCollectionMap[dict.option_collection_hash] =
dict.options.map(function(option) {
return option.name; }).join(" ");
ThOptionCollectionModel.get_list().success(
function(optCollectionData) {
// gather the string representations of option collections
_.each(optCollectionData, function(optColl) {
optionCollectionMap[optColl.option_collection_hash] =
_.uniq(_.map(optColl.options, function(option) {
return option.name;
})).sort().join();
});
}).then(function() {
if ($stateParams.series) {
Expand Down
3 changes: 3 additions & 0 deletions ui/perf.html
Expand Up @@ -36,6 +36,9 @@
<script src="vendor/mousetrap.min.js"></script>
<script src="js/treeherder.js"></script>
<script src="js/providers.js"></script>
<script src="js/models/option_collection.js"></script>
<script src="js/services/main.js"></script>
<script src="js/services/log.js"></script>
<script src="js/perf.js"></script>
<!-- endbuild -->

Expand Down

0 comments on commit 8732565

Please sign in to comment.