report(perf-audits): adjust presentation of runtime cost audits (#4020)

This commit is contained in:
Paul Irish 2017-12-11 10:48:52 -08:00 коммит произвёл GitHub
Родитель e217d090db
Коммит f49ef06025
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 7 добавлений и 7 удалений

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

@ -18,7 +18,7 @@ class BootupTime extends Audit {
return {
category: 'Performance',
name: 'bootup-time',
description: 'JavaScript boot-up time is high (> 4s)',
description: 'JavaScript boot-up time',
failureDescription: 'JavaScript boot-up time is too high',
helpText: 'Consider reducing the time spent parsing, compiling and executing JS. ' +
'You may find delivering smaller JS payloads helps with this.',
@ -93,7 +93,7 @@ class BootupTime extends Audit {
const tableDetails = BootupTime.makeTableDetails(headings, results);
return {
score: totalBootupTime < 4000,
score: totalBootupTime < 2000,
rawValue: totalBootupTime,
displayValue: Util.formatMilliseconds(totalBootupTime),
details: tableDetails,

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

@ -85,7 +85,7 @@ class PageExecutionTimings extends Audit {
const tableDetails = PageExecutionTimings.makeTableDetails(headings, results);
return {
score: false,
score: totalExecutionTime < 3000,
rawValue: totalExecutionTime,
displayValue: Util.formatMilliseconds(totalExecutionTime),
details: tableDetails,

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

@ -71,7 +71,7 @@ describe('Performance: page execution timings audit', () => {
const valueOf = name => Math.round(output.extendedInfo.value[name]);
assert.equal(output.details.items.length, 12);
assert.equal(output.score, false);
assert.equal(output.score, true);
assert.equal(Math.round(output.rawValue), 611);
for (const category in output.extendedInfo.value) {
@ -92,7 +92,7 @@ describe('Performance: page execution timings audit', () => {
return PageExecutionTimings.audit(artifacts).then(output => {
const valueOf = name => Math.round(output.extendedInfo.value[name]);
assert.equal(output.details.items.length, 13);
assert.equal(output.score, false);
assert.equal(output.score, true);
assert.equal(Math.round(output.rawValue), 596);
for (const category in output.extendedInfo.value) {
@ -113,7 +113,7 @@ describe('Performance: page execution timings audit', () => {
return PageExecutionTimings.audit(artifacts).then(output => {
const valueOf = name => Math.round(output.extendedInfo.value[name]);
assert.equal(output.details.items.length, 12);
assert.equal(output.score, false);
assert.equal(output.score, true);
assert.equal(Math.round(output.rawValue), 524);
for (const category in output.extendedInfo.value) {
@ -133,7 +133,7 @@ describe('Performance: page execution timings audit', () => {
return PageExecutionTimings.audit(artifacts).then(output => {
assert.equal(output.details.items.length, 0);
assert.equal(output.score, false);
assert.equal(output.score, true);
assert.equal(Math.round(output.rawValue), 0);
});
});