Add Google Web Vitals per run (#3437)

This commit is contained in:
Peter Hedenskog 2021-08-18 13:52:59 +02:00 committed by GitHub
parent a5d5ca67ec
commit 13216a1de6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 6 deletions

View File

@ -33,12 +33,14 @@ module.exports = {
}
if (browsertimeRunData.googleWebVitals) {
statsHelpers.pushGroupStats(
this.statsPerType,
this.groups[group],
['googleWebVitals'],
browsertimeRunData.googleWebVitals
);
for (let metric of Object.keys(browsertimeRunData.googleWebVitals)) {
statsHelpers.pushGroupStats(
this.statsPerType,
this.groups[group],
['googleWebVitals', metric],
browsertimeRunData.googleWebVitals[metric]
);
}
}
if (browsertimeRunData.timings.largestContentfulPaint) {

View File

@ -206,6 +206,11 @@ module.exports = {
run.visualMetrics = result[resultIndex].visualMetrics[runIndex];
}
if (result[resultIndex].googleWebVitals) {
run.googleWebVitals =
result[resultIndex].googleWebVitals[runIndex];
}
let harIndex = runIndex * result.length;
harIndex += resultIndex;
if (result.har) {