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
Are fetchStart, connectStart, redirectStart relative to navigationStart? #237
Comments
What's loadEventEnd? But yes, the values returned in the API are relative to the timeOrigin (so yea, navigationStart). |
Okay. Thank you. The numbers I'm seeing in our RUM datasets are weird based on the definition you confirmed. I am seeing
for a lot of RUM samples. And as per the definition startTime should equal Both loadEventEnd and fetchStart not being relative to navigationStart is the only explanation I can think of for this which doesn't agree with the spec. Any thoughts on why this could be happening? |
How much bigger is it? I would suggest looking at performance.timeOrigin, how different is it from navigationStart? The former is the one used for startTime, and also we jitter the values so that could affect this kind of comparison. Also worth double checking that the fetch begins directly on onLoad and not in a promise inside it, or something like that which introduces some delay. |
Do you have a page that reproduces this problem? Have you seen this across browsers, or only in specific ones?
In that case, the If that's not the issue, there are a few known browser bugs with |
Hi @npm1, And I verified the code to make the resource we are fetching happens on the onLoad event of the window, something like, window.addEventListener('load', () => { getMyApiDataUsingFetch(); }); |
One additional idea: locally you could log performance.now() at the beginning and at the end of the load event to know the time frame where we were expecting the fetch to begin. That said, fetching is inherently asynchronous in modern browsers, so I'm not surprised that this happens in some cases. That is, the process that runs the JavaScript is not the same as the process which performs the network requests, so this could explain why you may see this kind of result, unless you use an async function and await the fetch. |
Hi @nicjansma,
Is Thanks for all the ideas @npm1 :) |
Correct If you're executing code at |
@Nithanaroy I believe we've addressed your issue, but please leave a comment if there is still a question here! |
I think you meant the other way around, right? 🙂 |
Times like fetchStart, connectStart, redirectStart are not timestamps to compare with page level metrics like loadEventEnd. Are they relative to navigationStart?
The text was updated successfully, but these errors were encountered: