Fix ratio to percent on failure rate graphs

This commit fixes the ratio values to percent on failure rate graphs. We
already use percents in many graphs and users are familiar with percents
rather than ratio.

Change-Id: I056b62b215230b4666401eabace42cac7e68201d
Closes-Bug: #1674066
This commit is contained in:
Masayuki Igawa 2017-03-19 16:34:04 +08:00
parent 609178cd42
commit c72ab70202
No known key found for this signature in database
GPG Key ID: 251CCDE9053850E4
9 changed files with 10 additions and 10 deletions

View File

@ -110,7 +110,7 @@ function GroupedRunsController(
failRateEntries.push({
x: new Date(timedelta.datetime).getTime(),
y: failRate
y: failRate * 100
});
});

View File

@ -69,7 +69,7 @@ function HomeController(
angular.forEach(dateStats, function(stats) {
entries.passes.push(generateChartData(stats.date, stats.metrics.passes));
entries.failures.push(generateChartData(stats.date, stats.metrics.failures));
entries.failRate.push(generateChartData(stats.date, stats.metrics.failRate));
entries.failRate.push(generateChartData(stats.date, stats.metrics.failRate * 100));
});
entries.passes = entries.passes.sort(byDate);
entries.failures = entries.failures.sort(byDate);

View File

@ -131,7 +131,7 @@ function JobController(
failRate = totalFail / (totalFail + totalPass) || DEFAULT_FAIL_RATE;
failRateEntries.push({
x: new Date(date).getTime(),
y: failRate
y: failRate * 100
});
skipEntries.push({

View File

@ -80,7 +80,7 @@
granular-format="%x %X"></chart-axis>
<chart-axis name="y" opposes="x" type="linear"
path=".y" align="left" orient="vertical"
domain="[0, 1]" draw="true"
domain="[0, 100]" draw="true"
granular-format=".3f"></chart-axis>
<chart-dataset name="rate"

View File

@ -83,7 +83,7 @@
granular-format="%x %X"></chart-axis>
<chart-axis name="y" type="linear" path=".y" opposes="x"
align="left" orient="vertical"
domain="[0, 1]" draw="true"
domain="[0, 100]" draw="true"
granular-format=".3f"></chart-axis>
<chart-dataset name="rate"

View File

@ -87,7 +87,7 @@
granular-format="%x %X"></chart-axis>
<chart-axis name="y" opposes="x" type="linear"
path=".y" align="left" orient="vertical"
domain="[0, 1]" draw="true"
domain="[0, 100]" draw="true"
granular-format=".3f"></chart-axis>
<chart-dataset name="rate"

View File

@ -155,7 +155,7 @@ describe('GroupedRunsController', function() {
expect(groupedRunsController.failRates).toEqual([{
x: 1416355200000,
y: 0.023529411764705883
y: 2.3529411764705883
}]);
});
});

View File

@ -70,7 +70,7 @@ describe('HomeController', function() {
beforeEach(function() {
var date = new Date('2015-10-01T20:00:00.000Z');
timestamp = date.getTime();
var metrics = { passes: 3, failures: 4, failRate: 0.57 };
var metrics = { passes: 3, failures: 4, failRate: 56.99999999999999 };
var stats = [{ date: date, metrics: metrics }];
projectService.getStatsByDate = function() { return stats; };
homeController.loadData();
@ -82,7 +82,7 @@ describe('HomeController', function() {
});
it('should contain data for failure rate', function() {
expect(homeController.failRate).toEqual([{ x: 1443729600000, y: 0.57 }]);
expect(homeController.failRate).toEqual([{ x: 1443729600000, y: 5699.999999999999 }]);
});
});

View File

@ -147,7 +147,7 @@ describe('JobController', function() {
expect(jobController.failRates).toEqual([{
x: 1416358800000,
y: 0.018867924528301886
y: 1.8867924528301887
}]);
});