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

🐛 [RUMF-1337] Fix incorrect fetch duration #1875

Merged

Conversation

liywjl
Copy link
Contributor

@liywjl liywjl commented Dec 14, 2022

Reverts #1873

Originally merged in as #1862


Motivation

Release the feature intruded in #1810 to increase:

  • the precision of fetch duration
  • the number of matches for fetch resource timings

How?

Some fetch resources, we were under reporting fetch's duration. This was because fetch does not resolve when the payload has been downloaded but rather when the response is first received.

The example below only would calculate the duration of the fetch's resolve:

startDuration()
fetch('/').then(res => {
  stopDuration()
  // ...
})

To fix this, we listen to fetch's Response.body stream to listen for the completion of the stream before calculation fetch's duration (code).

Fetch resource timings

PerformanceResourceTiming are precise timing metrics supplied to us by the browser, that we use to enrich our data. This data is generated after fetch has completed.

This fix will thus increase our probability of finding a match; as before we were requesting this information too early.

Changes

  • remove fetch_duration feature flag
  • remove adjacent tests

Testing

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

@liywjl liywjl requested a review from a team as a code owner December 14, 2022 08:54
@liywjl liywjl merged commit e5c2966 into main Dec 14, 2022
@liywjl liywjl deleted the revert-1873-revert-1862-william/remove-fetch_duration-flag branch December 14, 2022 09:06
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.

2 participants