From fa837c3f66823e09986f9d3926a6582815cb573f Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Thu, 4 Aug 2016 18:31:45 -0700 Subject: [PATCH] cleanTrace acts on the whole trace --- lighthouse-core/config/index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lighthouse-core/config/index.js b/lighthouse-core/config/index.js index eefeebdce466..1bea0e1e49ae 100644 --- a/lighthouse-core/config/index.js +++ b/lighthouse-core/config/index.js @@ -28,7 +28,8 @@ const log = require('../lib/log'); // and to change TracingStartedInBrowser events into TracingStartedInPage. // This is done by searching for most occuring threads and basing new events // off of those. -function cleanTrace(traceEvents) { +function cleanTrace(trace) { + const traceEvents = trace.traceEvents; // Keep track of most occuring threads const threads = []; const countsByThread = {}; @@ -103,7 +104,7 @@ function cleanTrace(traceEvents) { // and using TS of first found TracingStartedIn* event traceEvents.unshift(makeMockEvent(mostActiveFrame, ts)); - return traceEvents; + return trace; } function filterPasses(passes, audits) { @@ -196,7 +197,7 @@ function expandArtifacts(artifacts, includeSpeedline) { traceEvents: trace }; } - cleanTrace(trace.traceEvents); + trace = cleanTrace(trace); expandedArtifacts.traces[key] = trace; });