@@ -48,7 +48,7 @@ const PROXY_IDLE_TIMEOUT_MS = 10000;
48
48
const EVENT_LOOP_PERF_MEASUREMENT_MS = 5000 ;
49
49
50
50
const MIN_PING_TO_REPORT = 500 ;
51
- const MIN_EVENT_LOOP_DELAY_TO_REPORT = 500 ;
51
+ const MIN_EVENT_LOOP_DELAY_PERCENT_TO_REPORT = 20 ;
52
52
53
53
const INTERNAL_ERROR_CODE = 1011 ;
54
54
@@ -422,25 +422,22 @@ export default class InspectorProxy implements InspectorProxyQueries {
422
422
const eventLoopUtilization = Math . floor ( eluEnd . utilization * 100 ) ;
423
423
424
424
// The max % of continious time between eluStart and eluEnd where event loop was busy
425
- const maxEventLoopDelay = Math . floor (
425
+ const maxEventLoopDelayPercent = Math . floor (
426
426
( h . max / 1e6 / EVENT_LOOP_PERF_MEASUREMENT_MS ) * 100 ,
427
427
) ;
428
428
429
- if (
430
- debug . enabled &&
431
- maxEventLoopDelay >= MIN_EVENT_LOOP_DELAY_TO_REPORT
432
- ) {
429
+ if ( maxEventLoopDelayPercent >= MIN_EVENT_LOOP_DELAY_PERCENT_TO_REPORT ) {
433
430
debug (
434
- "High event loop delay in the last %ds- event loop utilization='%d%' max event loop delay='%d%'" ,
431
+ "[perf] high event loop delay in the last %ds- event loop utilization='%d%' max event loop delay percent ='%d%'" ,
435
432
EVENT_LOOP_PERF_MEASUREMENT_MS / 1000 ,
436
433
eventLoopUtilization ,
437
- maxEventLoopDelay ,
434
+ maxEventLoopDelayPercent ,
438
435
) ;
439
436
440
437
this . #eventReporter?. logEvent ( {
441
438
type : 'high_event_loop_delay' ,
442
439
eventLoopUtilization,
443
- maxEventLoopDelay ,
440
+ maxEventLoopDelayPercent ,
444
441
duration : EVENT_LOOP_PERF_MEASUREMENT_MS ,
445
442
...debuggerSessionIDs ,
446
443
} ) ;
@@ -626,7 +623,7 @@ export default class InspectorProxy implements InspectorProxyQueries {
626
623
socket . on ( 'pong' , ( ) => {
627
624
const roundtripDuration = Date . now ( ) - latestPingMs ;
628
625
629
- if ( debug . enabled && roundtripDuration >= MIN_PING_TO_REPORT ) {
626
+ if ( roundtripDuration >= MIN_PING_TO_REPORT ) {
630
627
const isIdle = this . #isIdle( ) ;
631
628
632
629
debug (
0 commit comments