Skip to content

Commit

Permalink
feat: collect timings on profiler stop calls
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasBa committed Jun 27, 2023
1 parent 0c19446 commit 78e250b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 0 additions & 4 deletions packages/browser/src/profiling/cache.ts

This file was deleted.

5 changes: 5 additions & 0 deletions packages/browser/src/profiling/hubextensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,13 @@ export function wrapTransactionWithProfiling(transaction: Transaction): Transact
return null;
}

const stopProfilerSpan = transaction.startChild({ description: 'profiler.stop' });

return profiler
.stop()
.then((p: JSSelfProfile): null => {
stopProfilerSpan.finish();

if (maxDurationTimeoutID) {
WINDOW.clearTimeout(maxDurationTimeoutID);
maxDurationTimeoutID = undefined;
Expand All @@ -199,6 +203,7 @@ export function wrapTransactionWithProfiling(transaction: Transaction): Transact
return null;
})
.catch(error => {
stopProfilerSpan.finish();
if (__DEBUG_BUILD__) {
logger.log('[Profiling] error while stopping profiler:', error);
}
Expand Down

0 comments on commit 78e250b

Please sign in to comment.