-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
ref: Remove performance clear entry calls #2490
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
Merged
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -182,6 +182,20 @@ export class Tracing implements Integration { | |
| public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void { | ||
| Tracing._getCurrentHub = getCurrentHub; | ||
|
|
||
| if (global.performance) { | ||
| // The Performance object has a limited buffer size, often 150 entries. At some point the buffer may overflow, in | ||
| // which case we would not be able to use it to create/update spans. | ||
| // https://developer.mozilla.org/en-US/docs/Web/API/Performance | ||
| const oldCallback = performance.onresourcetimingbufferfull; | ||
| performance.onresourcetimingbufferfull = function(_event: unknown): void { | ||
| logger.warn('[Tracing]: Resource Timing Buffer is FULL! Increasing it to 300'); | ||
| performance.setResourceTimingBufferSize(300); | ||
rhcarvalho marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| if (oldCallback) { | ||
| oldCallback.apply(this, arguments); | ||
| } | ||
| }; | ||
| } | ||
|
|
||
| if (this._emitOptionsWarning) { | ||
| logger.warn( | ||
| '[Tracing] You need to define `tracingOrigins` in the options. Set an array of urls or patterns to trace.', | ||
|
|
@@ -603,14 +617,6 @@ export class Tracing implements Integration { | |
| addSpan(evaluation); | ||
| } | ||
|
|
||
| // The Performance object has a limited buffer size, often 150 entries. At some point the buffer may overflow, in | ||
| // which case we would not be able to use it to create/update spans. Therefore, after we have processed entries to | ||
| // report to Sentry, we clear the buffer in an attempt to allow for more entries to be added in the future. | ||
| // https://developer.mozilla.org/en-US/docs/Web/API/Performance | ||
| logger.log('[Tracing] Clearing most performance marks'); | ||
| performance.clearMarks(); | ||
| performance.clearMeasures(); | ||
| performance.clearResourceTimings(); | ||
|
Comment on lines
-606
to
-613
Contributor
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. 👍 |
||
| Tracing._performanceCursor = Math.max(performance.getEntries().length - 1, 0); | ||
|
|
||
| // tslint:enable: no-unsafe-any | ||
|
|
||
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.
Uh oh!
There was an error while loading. Please reload this page.