fix: Server Timing - Remove reliance on performance API #930
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.
Removing reliance on the browser resources API for the calculation of New Relic server time. On site with many resource requests, there was a small chance that the RUM network call would be flushed from the resources API cache before we could capture it and calculate server time.
Overview
Simplifying the NR server time calculation to use our own captured start and end times for the RUM network request. On our internal NR site, we were rarely seeing an error related to the time keeper not being able to calculate server time. The cause was found to be the RUM call missing from the resources API buffer. This is most likely because there is a max buffer size in the browser after which the browser starts dropping older resource requests.
We decided to not use a more precise method of setting up a resource observer simply because it has a lot of code and logic overhead for little gain (hundreds of milliseconds). We are also planning to cache the server time across page loads and tabs.
Related Issue(s)
N/A - Pre-release issue
Testing