Add extra metrics to the budget (#3484)

This commit is contained in:
Peter Hedenskog 2021-10-13 15:53:51 +02:00 committed by GitHub
parent c5c8241c50
commit 5a7147a579
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 26 additions and 0 deletions

View File

@ -131,6 +131,32 @@ module.exports = {
log.error(`Could not find the user timing ${metric}`);
continue;
}
} else if (metricType === 'extras' && tool === 'browsertime') {
const budgetValue = budgetForThisURL[metricType][metric];
const value = get(
message.data,
'statistics.extras.' + metric + '.median'
);
if (value) {
const item = getItem(
{ name: metric, format: time.ms },
metricType,
metric,
value,
budgetValue,
'max'
);
if (value > budgetValue) {
item.status = 'failing';
failing.push(item);
} else {
working.push(item);
}
continue;
} else {
log.error(`Could not find the extra metric ${metric}`);
continue;
}
}
}
}