-
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
core(metrics): switch to speedIndex from perceptualSpeedIndex #4980
Conversation
}); | ||
}).catch(err => { | ||
if (/No screenshots found in trace/.test(err.message)) { | ||
throw new LHError(LHError.errors.NO_SCREENSHOTS); | ||
} | ||
|
||
throw err; | ||
}).then(speedline => { | ||
if (speedline.frames.length === 0) { |
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.
this was done just in the audit, but it makes sense to be doing this everywhere speedline is needed, moved the test as well
I'd like to add that the mentioned paper considers suggests speed index up to onload to be a potential improvement. While we can see the value in using that to weed out the carousel/modal problem, it would face some challenges with edge cases like the polymer shop (which fires onload very early, way. before the page has finished) |
yeah definitely would love to explore this in the future, but agreed there are too many thorny issues to jump to without thorough investigation |
lighthouse-core/audits/metrics.js
Outdated
@@ -50,6 +56,23 @@ class Metrics extends Audit { | |||
metrics.push({metricName, timing, timestamp}); | |||
} | |||
|
|||
// Include some visual metrics from speedline | |||
metrics.push({ | |||
metricName: 'traceFirstVisualChange', |
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.
I feel like these aren't from the trace
so i think we want a diff prefix.
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.
open to ideas, I'd like to be consistent here on the fact that these are the raw observed values compared to the (potentially) simulated metric values
WDYT about observedMetricName
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.
hmm okay. maybe we use 'observed' prefix?
(don't tell me i suggested we use 'trace' instead of 'observed' 😨 )
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.
no no you're 😎 I originally had raw
haha which was just worse, I didn't think to suggest observed until now :)
* @return {Promise<LH.Artifacts.Metric>} | ||
*/ | ||
async computeObservedMetric(data, artifacts) { | ||
const speedline = await artifacts.requestSpeedline(data.trace); |
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.
should we just collapse these 2 into 1?
not sure if we use speedline for non-speedindex purposes.
i guess if we'd want firstVC or lastVC but no speedindex computed?
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.
I'd like to keep them separate for exactly that reason, also if we want to do other stuff with the frames
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.
aiight groovy. 🕺
metrics.push(Object.assign({metricName}, values)); | ||
metrics.push({ | ||
metricName, | ||
timing: Math.round(values.timing), |
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.
nice
"timestamp": 185608110912 | ||
}, | ||
{ | ||
"metricName": "traceSpeedIndex", |
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.
this duplicates "metricName": "speedIndex",
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.
it won't in simulated cases (just like FCP/FMP)
@paulirish was that all you had? I know blinkon is messing up the works |
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.
can wait for @paulirish, but LGTM2
except whatever happened to the tests :) I won't miss |
not sure what you mean, which tests what about them? haha I have so many ❓s :) |
I meant "LGTM except for whatever made the tests start failing" :) And one of the failures is eslint complaining about |
ooooh, yes I probably need to update some stuff from rebase |
speed-index-metric
audit tospeed-index
This was inconsistent with the names of all our other metric audits
While perceptual speed index was a nice experiment that had a few nice properties, it's not worth it.
Regular change that was coming anyhow, but consequences are the extendedInfo has moved to the
metrics
mega-audit.