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

Sites with redirects have wonky stats #2336

Closed
patrickhulce opened this issue May 22, 2017 · 10 comments
Closed

Sites with redirects have wonky stats #2336

patrickhulce opened this issue May 22, 2017 · 10 comments

Comments

@patrickhulce
Copy link
Collaborator

I was puzzling over some recent metrics on a plots run of http://www.vkontakte.ru/ which reported traceEnd as 5s shorter than the length of the trace. This is because we take our stats relative to navstart which removes the time of the initial HTTP request, it seems we have inconsistent handling somewhere though because TTCI failed even though there is 5s of quiet.

Example Screenshot
image

@patrickhulce
Copy link
Collaborator Author

Even more disturbing finding: traceviewer model does not give us timestamps that are relative to navstart but instead relative to TracingStartedInPage! This throws off all our timings and timestamps that use the traceviewer model, another great reason to get rid of it :)

@tdresser
Copy link

@deepanjanroy @benshayden

@patrickhulce
Copy link
Collaborator Author

Related: https://bugs.chromium.org/p/chromium/issues/detail?id=725301

LH-specific issues: We need to have consistent interpretation of task start/end timestamps by either remapping the times received from traceviewer model or remove it entirely and parse the trace ourselves

Overall metric questions: Which navstart in the trace is correct? window.performance identifies the beginning of the first request (the one that gets redirected) as startTime and the beginning of the final page request as requestStart. I'm inclined to prefer this interpretation as well so that sites with many potentially unnecessary redirects are penalized appropriately.

Supposedly there are cases though where the first navstart is not particularly interesting or plain wrong which is why LH looked for the last one? cc: @paulirish

@patrickhulce
Copy link
Collaborator Author

patrickhulce commented May 23, 2017

The switch to use the last navstart occurred here in response to tracingStartedInPage being after navStart and to move in alignment with traceviewer, though I believe we could still use the first navstart but just use the frameId from tracingStartedInPage

@deepanjanroy
Copy link
Contributor

Since lighthouse usually takes in a url, and gives back some metrics on that url, I think it makes sense to include the time for redirects. If I want to know the stats for http://example.com, I care about the total time from when I click the link to when key user events happen.

For traceviewer/chrome internal metrics, the story may be different - we'll have to think more about what makes sense.

@wardpeet
Copy link
Collaborator

going to link #2235 to this issue

@brendankenny
Copy link
Member

The switch to use the last navstart occurred here in response to tracingStartedInPage being after navStart and to move in alignment with traceviewer, though I believe we could still use the first navstart but just use the frameId from tracingStartedInPage

was there resolution on this? I don't remember the reasoning

@paulirish
Copy link
Member

Lantern doesn't consider navStart, but essentially uses start of HTML request as the time origin for stats. This likely leads to reduced variance, but some would argue the accuracy and/or truthiness is compromised.

@patrickhulce
Copy link
Collaborator Author

patrickhulce commented Apr 25, 2019

To clarify, Lantern uses the start of the very first request observed (which is when most people seem to think navstart should be), not the start of the HTML request, and it is navStart approach that reduces the variance at the expense of accuracy/truthiness by ignoring the time spent on certain cross-origin redirects.

See the above trace screenshots for the example where the time spent in the http://www.vkontakte.ru/ request is ignored from all of our metric user timings.

@patrickhulce
Copy link
Collaborator Author

This is a duplicate of #8984 which is currently in progress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants