-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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(diagnostics): add diagnostic audits #7052
Conversation
These are going to be hugely valuable! Great work so far @patrickhulce |
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.
Audits LGTM, not sure about the scoring of the audits, but since they are informational I guess it doesn't matter?
Mostly nits about the UIStrings and diagnostic suggestions.
return { | ||
score: 1, | ||
rawValue: 1, | ||
details: {items: [diagnostics]}, |
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.
Just a note probably for another PR, but this format is weird for informational audits. Can we make a new details format for just info? Like, just put the fields directly in details? Or if ts won't like that:
details: {
...
information: {
key: value,
...
},
...
}
The array makes it weird 😦
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.
yeah agreed, it's the same as the metrics audit for now
numFonts: records.filter(r => r.resourceType === 'Font').length, | ||
numTasks: toplevelTasks.length, | ||
numTasksOver10ms: toplevelTasks.filter(t => t.duration > 10).length, | ||
numTasksOver25ms: toplevelTasks.filter(t => t.duration > 25).length, |
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 numTasksOver50ms ? 😮
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.
heh, I'll add it, for lantern I was treating numTasksOver10ms
as the rough equivalent :)
const tasks = await MainThreadTasksComputed.request(trace, context); | ||
|
||
const results = tasks | ||
.filter(task => task.duration > 5) |
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 5ms threshold should get mentioned in the description, probably?
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.
sounds good
for (const [origin, additionalRtt] of analysis.additionalRttByOrigin.entries()) { | ||
// TODO: https://github.com/GoogleChrome/lighthouse/issues/7041 | ||
if (!Number.isFinite(additionalRtt)) continue; | ||
if (origin.startsWith('__')) continue; |
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.
who dat
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.
there's a __SUMMARY__
entry in there that has the overall information, I'll flip it to only include http
entries
|
||
const UIStrings = { | ||
/** Descriptive title of a Lighthouse audit that tells the user the server latencies observed from each origin the page connected to. This is displayed in a list of audit titles that Lighthouse generates. */ | ||
title: 'Server Latencies', |
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.
Server Backend Latencies
?
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.
done
title: 'Server Latencies', | ||
/** Description of a Lighthouse audit that tells the user that server latency can effect their website's performance negatively. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ | ||
description: 'Server latencies can impact web performance. ' + | ||
'If the server latency of an origin is high, it\'s an indication the server is overloaded ' + |
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 think this description should also indicate how the RTT is factored in. Are these values JUST the backend latency or the BL + RTT?
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's our best guess for "just the backend latency"
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'm not sure how to put this without unnecessarily confusing folks. I'm not confident that the number of people who will understand this subtlety is very high (or the people that will know what to do with this audit, honestly)
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.
k. well given the updated title change i think it's good.
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.
or the people that will know what to do with this audit, honestly
seems like the audit should always be hidden, then?
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.
Also adds two new user-facing audits for server latency by origin and RTT by origin.
can we split this out? I'm not sure why these are in this PR instead of their own :)
sure
because those are also critical page vitals that I've been using to debug variance |
0c164a2
to
73c49ec
Compare
Can this get some priority when reviewing as folks come back from NY? :) This is blocking my further efforts to expose variance, so I'd love to get it merged ASAP |
Proposed compromise: keep these audits in the PR but don't expose as user-facing. That can be done in a followup. |
Deal! |
lol, I was less concerned about the audits than the length of the PR (before tests). Do I need to forward "Small CLs" to everyone? :P Smaller PRs get reviewed faster and take fewer rounds of review! |
So is the conclusion that we're going back to the version without those two audits? I'm fine either way, but most recent attempt suggests the divide between L and XL does not help much in terms of eyeballs and I don't see a way of making this an XS/S with all our fixtures that get updated 😛 There's ~140 lines of substance, ~800 lines of fixtures, ~170 lines of strings/new audit boilerplate. Let me know how it'd be preferred to be divided for review. |
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 does feel like we're coming to a decision point with putting diagnostics in the LHR. LHRs are approaching ~1MB in size again. main-thread-tasks
doesn't end up too bad (2-6% on bad sites), but network-requests
tends to be big (10-15% on bad sites, basically the same size as the thumbnails), all for data that is looked at a tiny fraction of the times LH is run.
At some point we should ask folks to just save artifacts, cause that's what they really want. Or maybe we make a --preset=diagnostic
and add these audits or something.
Aside from that, everything here LGTM, but it all needs tests :S
title: 'Server Latencies', | ||
/** Description of a Lighthouse audit that tells the user that server latency can effect their website's performance negatively. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ | ||
description: 'Server latencies can impact web performance. ' + | ||
'If the server latency of an origin is high, it\'s an indication the server is overloaded ' + |
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.
or the people that will know what to do with this audit, honestly
seems like the audit should always be hidden, then?
{id: 'network-rtt', weight: 0}, | ||
{id: 'network-server-latency', weight: 0}, | ||
{id: 'main-thread-tasks', weight: 0}, | ||
{id: 'diagnostics', weight: 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.
can we move these audits down to the bottom and add a comment? Kind of subtle that no group
in the performance category means they're not visible :)
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.
done
*/ | ||
'use strict'; | ||
|
||
const Audit = require('./audit'); |
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.
.js
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.
done
const results = []; | ||
for (const [origin, additionalRtt] of analysis.additionalRttByOrigin.entries()) { | ||
// TODO: https://github.com/GoogleChrome/lighthouse/issues/7041 | ||
if (!Number.isFinite(additionalRtt)) continue; |
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.
seems important to include these if using them for debugging/anomaly spotting?
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.
good point, done
const tableDetails = Audit.makeTableDetails(headings, results); | ||
|
||
return { | ||
score: Math.max(1 - (maxLatency / 500), 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.
fwiw, if it's informative
this gets nulled out
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.
removed
I played around with it being scored, but that felt like it put too much emphasis on it
@@ -96,9 +96,21 @@ Object { | |||
Object { | |||
"path": "font-display", | |||
}, | |||
Object { |
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.
needs to be updated
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.
done
Yeah, I agree. I also think we need to find a balance with being able to provide a bit more information when users are confused though. There's the extreme like #5844, but basic stats on the page seem like fair game for intermediate devs to understand. I think there's value in having diagnostic information available in the report (even if it should be hidden a bit), so that a junior dev can call over to someone who knows a bit more and help them interpret something when things get trickier. |
bump |
🏏 🏏 🏏 |
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 somehow completely missed your push/bump last week and was still waiting for your update. Really sorry to make you wait on this.
This reverts commit 4513546.
Summary
Collect page vital stats into a single audit. Also adds two new user-facing audits for server latency by origin and RTT by origin.
Related Issues/PRs
#6775