Skip to content

Commit

Permalink
Bug 1352207 - Compare view should show a tooltip on bars saying wheth…
Browse files Browse the repository at this point in the history
…er the result was better or worse (#2333)
  • Loading branch information
SJasoria authored and wlach committed Apr 11, 2017
1 parent 8181a77 commit 39e5e7c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions ui/js/filters.js
Expand Up @@ -183,3 +183,9 @@ treeherder.filter('displayPrecision', function() {
return parseFloat(input).toFixed(2);
};
});

treeherder.filter('absoluteValue', function() {
return function(input) {
return Math.abs(input);
};
});
5 changes: 4 additions & 1 deletion ui/partials/perf/comparetable.html
Expand Up @@ -82,7 +82,10 @@
replicates="compareResult.newRuns"></ph-average>
</td>
<td ng-class="$ctrl.getCompareClasses(compareResult)">
<span ng-if="compareResult.delta" class="detail-hint" uib-tooltip="Mean difference: {{compareResult.delta|displayPrecision}} (= {{compareResult.deltaPercentage|displayPrecision}}%)">
<span ng-if="compareResult.delta && compareResult.newIsBetter" class="detail-hint" uib-tooltip="Mean difference: {{compareResult.delta|displayPrecision}} (= {{compareResult.deltaPercentage|displayPrecision|absoluteValue}}% better)">
{{compareResult.deltaPercentage|displayPrecision}}%
</span>
<span ng-if="compareResult.delta && !compareResult.newIsBetter" class="detail-hint" uib-tooltip="Mean difference: {{compareResult.delta|displayPrecision}} (= {{compareResult.deltaPercentage|displayPrecision|absoluteValue}}% worse)">
{{compareResult.deltaPercentage|displayPrecision}}%
</span>
</td>
Expand Down

0 comments on commit 39e5e7c

Please sign in to comment.