Skip to content

Commit

Permalink
Add visual metrics data to each run before we generate filmstrip data (
Browse files Browse the repository at this point in the history
  • Loading branch information
soulgalore committed Oct 13, 2019
1 parent af430a8 commit f774ba3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/plugins/browsertime/filmstrip.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function getMetricsFromBrowsertime(data) {
metrics.push({
metric: 'longTask',
name: 'CPU Long Task duration',
value: longTask.startTime,
value: longTask.startTime.toFixed(0),
duration: longTask.duration.toFixed(0)
});
}
Expand Down
15 changes: 7 additions & 8 deletions lib/plugins/browsertime/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,13 @@ module.exports = {
}
let runIndex = 0;
for (let run of result[resultIndex].browserScripts) {
// Kind of ugly way to add visualMetrics to a run
// it's outside of browserScripts today
// we could instead pass browsertime.visualMetrics maybe
if (result[resultIndex].visualMetrics) {
run.visualMetrics = result[resultIndex].visualMetrics[runIndex];
}

let harIndex = runIndex * result.length;
harIndex += resultIndex;
if (result.har) {
Expand Down Expand Up @@ -238,14 +245,6 @@ module.exports = {
);
}
}

// Kind of ugly way to add visualMetrics to a run
// it's outside of browserScripts today
// we could instead pass browsertime.visualMetrics maybe
if (result[resultIndex].visualMetrics) {
run.visualMetrics = result[resultIndex].visualMetrics[runIndex];
}

if (result[resultIndex].cpu) {
run.cpu = result[resultIndex].cpu[runIndex];
}
Expand Down

0 comments on commit f774ba3

Please sign in to comment.