fix: Replace performance.timeOrigin in favour of browserPerformanceTimeOrigin#3397
Merged
Conversation
Contributor
size-limit report
|
rhcarvalho
suggested changes
Apr 15, 2021
Contributor
rhcarvalho
left a comment
There was a problem hiding this comment.
One suggestion for simplification and we should see less weird transaction durations :) Thanks @dashed ❤️
| logger.log('[Measurements] Adding LCP'); | ||
| this._measurements['lcp'] = { value: metric.value }; | ||
| this._measurements['mark.lcp'] = { value: timeOrigin + startTime }; | ||
| if (browserPerformanceTimeOrigin !== undefined) { |
Contributor
There was a problem hiding this comment.
browserPerformanceTimeOrigin should always exist when we can actually report LCP and FID.
I'd just replace performance.timeOrigin above with browserPerformanceTimeOrigin.
I see we use performance.timeOrigin directly in ember... maybe we change that too, cc @k-fish.
Member
Author
There was a problem hiding this comment.
@rhcarvalho typescript told me that browserPerformanceTimeOrigin could be undefined, but I'll coerce it as a number
Contributor
There was a problem hiding this comment.
Yeah typescript... it is only undefined if performance is also undefined.
830c67e to
c016947
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Use
browserPerformanceTimeOriginin favour ofperformance.timeOriginwhen generating timestamps for the LCP and FID web vitals.