Created
April 16, 2015 19:23
-
-
Save wlach/6667777a1f229e033b6a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/webapp/app/css/perf.css b/webapp/app/css/perf.css | |
index 4ff945d..b069dca 100644 | |
--- a/webapp/app/css/perf.css | |
+++ b/webapp/app/css/perf.css | |
@@ -170,6 +170,16 @@ to { opacity: 0; } | |
color: white; | |
font-weight: bold; | |
} | |
+.subtest-regression { | |
+ background-color: red; | |
+ color: white; | |
+ font-weight: bold; | |
+} | |
+.subtest-improvement { | |
+ background-color: green; | |
+ color: white; | |
+ font-weight: bold; | |
+} | |
.subtest-result button { | |
display: none; | |
} | |
diff --git a/webapp/app/js/compare.js b/webapp/app/js/compare.js | |
index 44dd531..33e6723 100644 | |
--- a/webapp/app/js/compare.js | |
+++ b/webapp/app/js/compare.js | |
@@ -232,12 +232,11 @@ compare.controller('CompareCtrl', [ '$state', '$stateParams', '$scope', '$rootSc | |
cmap['delta'] = (cmap['newGeoMean'] - cmap['originalGeoMean']).toFixed(2); | |
cmap['deltaPercentage'] = (cmap['delta'] / cmap['originalGeoMean'] * 100).toFixed(2) + ' %'; | |
- cmap.type = 'data'; | |
//TODO: some tests are reverse, figure out how to account for that | |
if (cmap.delta < 0) { | |
- cmap.type = 'improvement'; | |
+ cmap.isImprovement = true; | |
} else if (cmap.delta > 1) { | |
- cmap.type = 'regression'; | |
+ cmap.isRegression = true; | |
} | |
//TODO: zoom? >1 highlighted revision? | |
diff --git a/webapp/app/partials/perf/comparectrl.html b/webapp/app/partials/perf/comparectrl.html | |
index 1852377..151d818 100644 | |
--- a/webapp/app/partials/perf/comparectrl.html | |
+++ b/webapp/app/partials/perf/comparectrl.html | |
@@ -28,10 +28,8 @@ | |
<td>{{compareResult.name}}</td> | |
<td ng-attr-title="runs: {{compareResult.originalRuns}}">{{compareResult.originalGeoMean}}</td><td>{{compareResult.originalVariation}}</td> | |
<td ng-attr-title="runs: {{compareResult.newRuns}}">{{compareResult.newGeoMean}}</td><td>{{compareResult.newVariation}}</td> | |
- <td ng-style="compareResult.type === 'regression' && {'background-color': 'red', 'color': 'white', 'font-weight': 'bold'} || | |
- compareResult.type === 'improvement' && {'background-color': 'green', 'color': 'white', 'font-weight': 'bold'}">{{compareResult.delta}}</td> | |
- <td ng-style="compareResult.type === 'regression' && {'background-color': 'red', 'color': 'white', 'font-weight': 'bold'} || | |
- compareResult.type === 'improvement' && {'background-color': 'green', 'color': 'white', 'font-weight': 'bold'}">{{compareResult.deltaPercentage}}</td> | |
+ <td ng-class="{subtest-regression: compareResult.isRegression, subtest-improvement: compareResult.isImprovement}">{{compareResult.delta}}</td> | |
+ <td ng-class="{subtest-regression: compareResult.isRegression, subtest-improvement: compareResult.isImprovement}">{{compareResult.deltaPercentage}}</td> | |
</tr> | |
</tbody> | |
</table> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment