Add extra metrics to the budget (#3484)
This commit is contained in:
parent
c5c8241c50
commit
5a7147a579
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue