1
1
import { createAbortController } from '../../common/AbortController.js' ;
2
2
import { AbortError } from '../../common/AbortError.js' ;
3
+ import { unrefInterval } from '../../common/intervalHelper.js' ;
3
4
import { TimeHelper } from '../../common/TimeHelper.js' ;
4
5
import { BacktraceMetricsOptions } from '../../model/configuration/BacktraceConfiguration.js' ;
5
6
import { AttributeType } from '../../model/data/BacktraceData.js' ;
6
- import { BacktraceModule } from '../BacktraceModule.js' ;
7
7
import { AttributeManager } from '../attribute/AttributeManager.js' ;
8
8
import { ReportDataBuilder } from '../attribute/ReportDataBuilder.js' ;
9
+ import { BacktraceModule } from '../BacktraceModule.js' ;
9
10
import { BacktraceSessionProvider } from './BacktraceSessionProvider.js' ;
10
11
import { MetricsQueue } from './MetricsQueue.js' ;
11
12
import { SummedEvent } from './model/SummedEvent.js' ;
@@ -28,7 +29,7 @@ export class BacktraceMetrics implements BacktraceModule {
28
29
public readonly metricsHost : string ;
29
30
private readonly _updateInterval : number ;
30
31
31
- private _updateIntervalId ?: ReturnType < typeof setTimeout > ;
32
+ private _updateIntervalId ?: NodeJS . Timeout | number ;
32
33
private readonly _abortController : AbortController ;
33
34
34
35
constructor (
@@ -60,7 +61,9 @@ export class BacktraceMetrics implements BacktraceModule {
60
61
}
61
62
this . _updateIntervalId = setInterval ( ( ) => {
62
63
this . handleAbort ( ( ) => this . send ( this . _abortController . signal ) ) ;
63
- } , this . _updateInterval ) ;
64
+ } , this . _updateInterval ) as NodeJS . Timeout | number ;
65
+
66
+ unrefInterval ( this . _updateIntervalId ) ;
64
67
}
65
68
66
69
/**
0 commit comments