Skip to content

Commit cda040f

Browse files
authored
doc: Explain why we call performance.clear* (#2480)
1 parent f8e8dc8 commit cda040f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/apm/src/integrations/tracing.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,10 @@ export class Tracing implements Integration {
517517
addSpan(evaluation);
518518
}
519519

520+
// The Performance object has a limited buffer size, often 150 entries. At some point the buffer may overflow, in
521+
// which case we would not be able to use it to create/update spans. Therefore, after we have processed entries to
522+
// report to Sentry, we clear the buffer in an attempt to allow for more entries to be added in the future.
523+
// https://developer.mozilla.org/en-US/docs/Web/API/Performance
520524
logger.log('[Tracing] Clearing most performance marks');
521525
performance.clearMarks();
522526
performance.clearMeasures();

0 commit comments

Comments
 (0)