Skip to content

Commit 88eb034

Browse files
authored
feat: collect timings on profiler stop calls (#8409)
Collect span information on how long the async calls to profiler.stop take which will help us evaluate if calling txn.finish after profiler.stop is a viable approach
1 parent ac435dd commit 88eb034

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

packages/browser/src/profiling/cache.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

packages/browser/src/profiling/hubextensions.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,15 @@ export function wrapTransactionWithProfiling(transaction: Transaction): Transact
172172
return null;
173173
}
174174

175+
// This is temporary - we will use the collected span data to evaluate
176+
// if deferring txn.finish until profiler resolves is a viable approach.
177+
const stopProfilerSpan = transaction.startChild({ description: 'profiler.stop', op: 'profiler' });
178+
175179
return profiler
176180
.stop()
177181
.then((p: JSSelfProfile): null => {
182+
stopProfilerSpan.finish();
183+
178184
if (maxDurationTimeoutID) {
179185
WINDOW.clearTimeout(maxDurationTimeoutID);
180186
maxDurationTimeoutID = undefined;
@@ -199,6 +205,7 @@ export function wrapTransactionWithProfiling(transaction: Transaction): Transact
199205
return null;
200206
})
201207
.catch(error => {
208+
stopProfilerSpan.finish();
202209
if (__DEBUG_BUILD__) {
203210
logger.log('[Profiling] error while stopping profiler:', error);
204211
}

0 commit comments

Comments
 (0)