Skip to content

Commit

Permalink
doc: Explain why we call performance.clear* (#2480)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhcarvalho authored Mar 9, 2020
1 parent f8e8dc8 commit cda040f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/apm/src/integrations/tracing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,10 @@ 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();
Expand Down

0 comments on commit cda040f

Please sign in to comment.