-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Dynamically load BrowserPerformanceMeasurement
to capture browser perf measurements if session storage flag is set
#6748
Conversation
6426d72
to
4d523b5
Compare
7caaead
to
4d2c212
Compare
BrowserPerformanceMeasurement
in favor of calculating telemetry event duration in place with browser performance APIBrowserPerformanceMeasurement
to capture browser perf measurements if session storage flag is set
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.
Looks good besides the breaking changes
b727943
to
884a55b
Compare
const inProgressEvent = super.startMeasurement( | ||
measureName, | ||
correlationId | ||
); | ||
const startTime: number | undefined = supportsBrowserPerformanceNow() | ||
? window.performance.now() | ||
: undefined; |
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.
What do we see in our telemetry if the performance API isn't available? Do we get some sort of indication or do we toss out the data?
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.
If performance API isn't available, then telemetry event duration is calculated using Unix epoch, a subject to clock skew, instead of browser.performance.now()
. No data is tossed out. There is no indication of performance API availability in telemetry though.
…elemetry event duration in place with browser performance API. - Calculate telemetry event duration using Unix epoch if browser performance API is not available.
…surements if session storage flag is enabled. - Update browser perf doc.
Co-authored-by: Thomas Norling <[email protected]>
- Move static functions out of BrowserPerformanceClient.ts.
e0a6bc4
to
b397807
Compare
Changes:
BrowserPerformanceMeasurement
to capture browser perf measurements if session storage flag is set.Background:
Browser performance measures introduce additional overhead caused by buffer polling and linear-ish time complexity when calling getEntriesByName(). We can directly use
window.performance.now()
instead to measure telemetry event duration.