Skip to content
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

Merged
merged 2 commits into from
May 9, 2017
Merged

Add details to "is fast on 3g" audit #2159

merged 2 commits into from
May 9, 2017

Conversation

ebidel
Copy link
Contributor

@ebidel ebidel commented May 5, 2017

R: all

This is really handy for debugging...knowing what requests failed the check.
screen shot 2017-05-05 at 10 23 23 am

@ebidel ebidel changed the title Add details to "Is fast on 3g" audit Add details to "is fast on 3g" audit May 5, 2017
@@ -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).',
Copy link
Member

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.

Copy link
Member

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};
Copy link
Member

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;

Copy link
Contributor Author

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);
Copy link
Member

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)'},
Copy link
Member

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..

Copy link
Contributor Author

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));
Copy link
Member

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

@brendankenny
Copy link
Member

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.

@ebidel
Copy link
Contributor Author

ebidel commented May 5, 2017

This is helpful for debugging, but isn't it irrelevant for the audit result?

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.

@brendankenny
Copy link
Member

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 areAllLatencies3G fails, but this feels more like a debugString situation

@ebidel
Copy link
Contributor Author

ebidel commented May 5, 2017

We could only include the details when areAllLatencies3G fails, but this feels more like a debugString situation

Yea, we should do that. debugString might be good, but we're not setup for that.

@ebidel
Copy link
Contributor Author

ebidel commented May 5, 2017

Changed so we only show the details when areLatenciesAll3G !== true.

Copy link
Member

@brendankenny brendankenny left a 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).',
Copy link
Member

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

@paulirish paulirish merged commit b50f780 into master May 9, 2017
@paulirish paulirish deleted the latencies branch May 9, 2017 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants