-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
fix(browser): Use drift-corrected time origin for INP, replay and profiling #23067
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,7 +12,7 @@ import type { | |
| ThreadCpuProfile, | ||
| } from '@sentry/core/browser'; | ||
| import { | ||
| browserPerformanceTimeOrigin, | ||
| correctedPerformanceTimeOrigin, | ||
| debug, | ||
| DEFAULT_ENVIRONMENT, | ||
| forEachEnvelopeItem, | ||
|
|
@@ -339,7 +339,7 @@ function convertToContinuousProfile(input: { | |
| } | ||
|
|
||
| // Align timestamps to SDK time origin to match span/event timelines | ||
| const perfOrigin = browserPerformanceTimeOrigin(); | ||
| const perfOrigin = correctedPerformanceTimeOrigin(); | ||
| const origin = typeof performance.timeOrigin === 'number' ? performance.timeOrigin : perfOrigin || 0; | ||
| const adjustForOriginChange = origin - (perfOrigin || origin); | ||
|
|
||
|
|
@@ -412,7 +412,7 @@ export function convertJSSelfProfileToSampledFormat(input: JSSelfProfile): Profi | |
| // when that happens, we need to ensure we are correcting the profile timings so the two timelines stay in sync. | ||
| // Since JS self profiling time origin is always initialized to performance.timeOrigin, we need to adjust for | ||
| // the drift between the SDK selected value and our profile time origin. | ||
| const perfOrigin = browserPerformanceTimeOrigin(); | ||
| const perfOrigin = correctedPerformanceTimeOrigin(); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Profile elapsed times shift after driftHigh Severity Switching Additional Locations (2)Reviewed by Cursor Bugbot for commit 25c1b28. Configure here. |
||
| const origin = typeof performance.timeOrigin === 'number' ? performance.timeOrigin : perfOrigin || 0; | ||
| const adjustForOriginChange = origin - (perfOrigin || origin); | ||
|
|
||
|
|
||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need both? I don't think we would like to use a non-accurate time origin anywhere, or maybe I misunderstood?