-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: normalize all times to navStart, remove traceviewer model #2347
Changes from 10 commits
e791557
8c2e789
15d9424
2fb8850
25f157c
ea619df
f32cccf
78036fc
ef2eccd
184537b
1a0aacb
9bfcdee
5f1a15f
65de1eb
ba571ab
f62b2a4
d4c4605
df3c12e
08797fc
2bb290b
71682ce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,7 +66,7 @@ class TTIMetric extends Audit { | |
|
||
// Get our expected latency for the time window | ||
const latencies = TracingProcessor.getRiskToResponsiveness( | ||
data.model, data.trace, startTime, endTime, percentiles); | ||
data.tabTrace, startTime, endTime, percentiles); | ||
const estLatency = latencies[0].time; | ||
foundLatencies.push({ | ||
estLatency: estLatency, | ||
|
@@ -162,10 +162,9 @@ class TTIMetric extends Audit { | |
debugString = `Trace error: ${err.message}`; | ||
return null; | ||
}), | ||
artifacts.requestTraceOfTab(trace), | ||
artifacts.requestTracingModel(trace) | ||
artifacts.requestTraceOfTab(trace) | ||
]; | ||
return Promise.all(pending).then(([speedline, tabTrace, model]) => { | ||
return Promise.all(pending).then(([speedline, tabTrace]) => { | ||
// frame monotonic timestamps from speedline are in ms (ts / 1000), so we'll match | ||
// https://github.com/pmdartus/speedline/blob/123f512632a/src/frame.js#L86 | ||
const fMPtsInMS = tabTrace.timestamps.firstMeaningfulPaint; | ||
|
@@ -191,7 +190,7 @@ class TTIMetric extends Audit { | |
} | ||
|
||
const times = {fmpTiming, visuallyReadyTiming, traceEndTiming}; | ||
const data = {tabTrace, model, trace}; | ||
const data = {tabTrace, trace}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. looks like only There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. or we can just kill the audit entirely :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. haha, good point. I'm fine with leaving as is and deleting it next :) |
||
const timeToInteractive = TTIMetric.findTTIAlpha(times, data); | ||
const timeToInteractiveB = TTIMetric.findTTIAlphaFMPOnly(times, data); | ||
const timeToInteractiveC = TTIMetric.findTTIAlphaFMPOnly5s(times, data); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,7 +38,7 @@ class TraceOfTab extends ComputedArtifact { | |
|
||
/** | ||
* @param {{traceEvents: !Array}} trace | ||
* @return {!{processEvents: !Array<TraceEvent>, startedInPageEvt: TraceEvent, navigationStartEvt: TraceEvent, firstContentfulPaintEvt: TraceEvent, firstMeaningfulPaintEvt: TraceEvent}} | ||
* @return {!TraceOfTabArtifact} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sure |
||
*/ | ||
compute_(trace) { | ||
// Parse the trace for our key events and sort them by timestamp. | ||
|
@@ -98,7 +98,11 @@ class TraceOfTab extends ComputedArtifact { | |
.filter(e => e.pid === startedInPageEvt.pid) | ||
.sort((event0, event1) => event0.ts - event1.ts); | ||
|
||
const traceEnd = trace.traceEvents.reduce((max, evt) => { | ||
const earliestTraceEvt = trace.traceEvents.reduce((min, evt) => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let's add this guy: const mainThreadEvents = processEvents
.filter(e => e.tid === startedInPageEvt.tid); There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
return evt.ts === 0 || min.ts <= evt.ts ? min : evt; | ||
}, {ts: Infinity}); | ||
|
||
const latestTraceEvt = trace.traceEvents.reduce((max, evt) => { | ||
return max.ts > evt.ts ? max : evt; | ||
}); | ||
|
||
|
@@ -107,7 +111,7 @@ class TraceOfTab extends ComputedArtifact { | |
firstPaint, | ||
firstContentfulPaint, | ||
firstMeaningfulPaint, | ||
traceEnd, | ||
traceEnd: latestTraceEvt, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
(and don't feel strongly about it, but There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had a very good explanation for why I named them this instead of traceEnd (that these were supposed to be just about the main thread, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah what do you think about using navStart and traceEnd timings instead of all this other nonsense entirely? |
||
onLoad, | ||
domContentLoaded, | ||
}; | ||
|
@@ -124,7 +128,9 @@ class TraceOfTab extends ComputedArtifact { | |
timings, | ||
timestamps, | ||
processEvents, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
startedInPageEvt: startedInPageEvt, | ||
earliestTraceEvt, | ||
latestTraceEvt, | ||
startedInPageEvt, | ||
navigationStartEvt: navigationStart, | ||
firstPaintEvt: firstPaint, | ||
firstContentfulPaintEvt: firstContentfulPaint, | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since it's static it would nice if this were able to be
.then(EstimatedInputLatency.calculate)
, though that would require cleaning up our uses ofthis
in hereThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done