Skip to content

Commit 72cd9aa

Browse files
authored
chore(debugger): add comment about thread paused time being approximate (#6900)
If debug logging is enabled, we log the main-thread paused time: Add a `~` prefix to indicate that this time is approximate and add a code comment with defails about this apprximation.
1 parent 28d8867 commit 72cd9aa

File tree

1 file changed

+3
-1
lines changed
  • packages/dd-trace/src/debugger/devtools_client

1 file changed

+3
-1
lines changed

packages/dd-trace/src/debugger/devtools_client/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,9 @@ session.on('Debugger.paused', async ({ params }) => {
168168
await session.post('Debugger.resume')
169169
const diff = process.hrtime.bigint() - start // TODO: Recored as telemetry (DEBUG-2858)
170170

171-
log.debug(() => `[debugger:devtools_client] Finished processing breakpoints - main thread paused for: ${
171+
// This doesn't measure the overhead of the CDP protocol. The actual pause time is slightly larger.
172+
// On my machine I'm seeing around 1.7ms of overhead.
173+
log.debug(() => `[debugger:devtools_client] Finished processing breakpoints - main thread paused for: ~${
172174
Number(diff) / 1_000_000
173175
} ms`)
174176

0 commit comments

Comments
 (0)