File tree 2 files changed +16
-5
lines changed
packages/dd-trace/src/debugger/devtools_client
2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ const { getLocalStateForCallFrame } = require('./snapshot')
7
7
const send = require ( './send' )
8
8
const { getStackFromCallFrames } = require ( './state' )
9
9
const { ackEmitting, ackError } = require ( './status' )
10
+ const { threadPausedMsMetric } = require ( './telemetry' )
10
11
const { parentThreadId } = require ( './config' )
11
12
const { MAX_SNAPSHOTS_PER_SECOND_GLOBALLY } = require ( './defaults' )
12
13
const log = require ( '../../log' )
@@ -101,12 +102,10 @@ session.on('Debugger.paused', async ({ params }) => {
101
102
}
102
103
103
104
await session . post ( 'Debugger.resume' )
104
- const diff = process . hrtime . bigint ( ) - start // TODO: Recored as telemetry (DEBUG-2858)
105
105
106
- log . debug (
107
- '[debugger:devtools_client] Finished processing breakpoints - main thread paused for: %d ms' ,
108
- Number ( diff ) / 1000000
109
- )
106
+ const diff = Number ( process . hrtime . bigint ( ) - start ) / 1_000_000
107
+ log . debug ( '[debugger:devtools_client] Finished processing breakpoints - instrumented thread paused for: %d ms' , diff )
108
+ threadPausedMsMetric ( diff )
110
109
111
110
// Due to the highly optimized algorithm above, the `probes` array might have gaps
112
111
probes = probes . filter ( ( probe ) => ! ! probe )
Original file line number Diff line number Diff line change
1
+ 'use strict'
2
+
3
+ const telemetryMetrics = require ( '../../telemetry/metrics' )
4
+
5
+ const debuggerNamespace = telemetryMetrics . manager . namespace ( 'debugger' )
6
+ const threadPausedDistribution = debuggerNamespace . distribution ( 'thread_paused.ms' , [ ] )
7
+
8
+ module . exports = {
9
+ threadPausedMsMetric ( ms ) {
10
+ threadPausedDistribution . track ( ms )
11
+ }
12
+ }
You can’t perform that action at this time.
0 commit comments