🐛 [RUMF-1337] Fix incorrect fetch duration #1875
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reverts #1873
Originally merged in as #1862
Motivation
Release the feature intruded in #1810 to increase:
fetch
durationfetch
resource timingsHow?
Some
fetch
resources, we were under reportingfetch
's duration. This was becausefetch
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:To fix this, we listen to
fetch
's Response.body stream to listen for the completion of the stream before calculationfetch'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
fetch_duration
feature flagTesting
I have gone over the contributing documentation.