-
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
Add details to "is fast on 3g" audit #2159
Conversation
@@ -41,7 +40,7 @@ class LoadFastEnough4Pwa extends Audit { | |||
category: 'PWA', | |||
name: 'load-fast-enough-for-pwa', | |||
description: 'Page load is fast enough on 3G', | |||
helpText: 'Satisfied if the _Time To Interactive_ duration is shorter than _10 seconds_, as defined by the [PWA Baseline Checklist](https://developers.google.com/web/progressive-web-apps/checklist). Network throttling is required (specifically: RTT latencies >= 150 RTT are expected).', |
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.
we'll need to decide if we want to essentially rename "FI" to "TTI" and bury the old one as version 0.1.
if we dont then we'll have to change this text.
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.
if we dont then we'll have to change this text.
I'd like to keep it a little while longer, at least. I want to get a few plots/ runs in with it
probably makes sense to change the test regardless to reduce confusion with Consistently Interactive
@@ -57,16 +56,21 @@ class LoadFastEnough4Pwa extends Audit { | |||
// Ignore requests that don't have timing data or resources that have | |||
// previously been requested and are coming from the cache. | |||
if (!record._timing || record._fromDiskCache || record._fromMemoryCache) { | |||
return undefined; | |||
return {url: record._url}; |
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 we're now using an object we can be more explicit
const ret = {url: record._url};
if (!record._timing)) ret.isMissingTiming = true;
if (record._fromDiskCache || record._fromMemoryCache) ret.isFromCache = true;
if (ret.isFromCache || ret.isMissingTiming) return ret;
ret.latency = record._timing.receiveHeadersEnd - record._timing.sendEnd;
ret.latencyStr = ret.latency.toLocaleString(undefined, {maximumFractionDigits: 2});
return ret;
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 can use more vars in the code if it'll make that part more clear, but I'm thinking we should start being diligent about sliming down audit results. Extra bits are nice, but if we're not going to use them in a renderer, they're extra weight.
}); | ||
|
||
const latency3gMin = Emulation.settings.TYPICAL_MOBILE_THROTTLING_METRICS.latency - 10; | ||
const areLatenciesAll3G = allRequestLatencies.every(val => | ||
val === undefined || val > latency3gMin); | ||
val.latency === undefined || val.latency > latency3gMin); |
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.
const excludedLatencies = allRequestLatencies.filter(val => val.isFromCache || val.isMissingTiming);
const includedLatencies = allRequestLatencies.filter(val => !excludedLatencies.includes(val));
// assert includedLatencies.length > 1
const areLatenciesAll3G = includedLatencies.every(val => val.latency > latency3gMin);
@@ -78,12 +82,18 @@ class LoadFastEnough4Pwa extends Audit { | |||
value: {areLatenciesAll3G, allRequestLatencies, isFast, timeToFirstInteractive} | |||
}; | |||
|
|||
const details = Audit.makeV2TableDetails([ | |||
{key: 'url', itemType: 'url', text: 'URL'}, | |||
{key: 'latency', itemType: 'text', text: 'Latency (ms)'}, |
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.
key: 'latencyStr'
and you could add another column for "Cached?" in here..
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.
Is a cached column worth showing? In theory, this table doesn't contain any requests that come from the cache.
const details = Audit.makeV2TableDetails([ | ||
{key: 'url', itemType: 'url', text: 'URL'}, | ||
{key: 'latency', itemType: 'text', text: 'Latency (ms)'}, | ||
], allRequestLatencies.filter(record => record.latency !== undefined)); |
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.
and replace this guy with excludedLatencies
This is helpful for debugging, but isn't it irrelevant for the audit result? The audit is for TTFI, the 3g check is just to make sure we can do the check. If a user wants to know why their TTIFI was too slow this table doesn't help. |
We say "Network throttling is required (specifically: RTT latencies >= 150 RTT are expected)." Without seeing which requests didn't meet that requirement, it's hard to know why you failed the audit. |
But it's non-actionable information that looks like it's something they're doing, but unless they disabled throttling it's a lighthouse bug -- we didn't throttle everything correctly (or it's something like the caching bug). They can't slow down server responses in order to pass the test :) We could only include the details when |
Yea, we should do that. |
Changed so we only show the details when |
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 still seems like this will be a bit confusing (nothing for the user to fix; maybe we should add a call to report a bug in a header or something?), but I don't feel super strongly :)
@@ -41,7 +40,7 @@ class LoadFastEnough4Pwa extends Audit { | |||
category: 'PWA', | |||
name: 'load-fast-enough-for-pwa', | |||
description: 'Page load is fast enough on 3G', | |||
helpText: 'Satisfied if the _Time To Interactive_ duration is shorter than _10 seconds_, as defined by the [PWA Baseline Checklist](https://developers.google.com/web/progressive-web-apps/checklist). Network throttling is required (specifically: RTT latencies >= 150 RTT are expected).', |
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.
if we dont then we'll have to change this text.
I'd like to keep it a little while longer, at least. I want to get a few plots/ runs in with it
probably makes sense to change the test regardless to reduce confusion with Consistently Interactive
R: all
This is really handy for debugging...knowing what requests failed the check.