@@ -4,30 +4,30 @@ import {
4
4
IssueType ,
5
5
WebRTCStatsParsed ,
6
6
} from '../types' ;
7
- import BaseIssueDetector from './BaseIssueDetector' ;
7
+ import BaseIssueDetector , { BaseIssueDetectorParams } from './BaseIssueDetector' ;
8
8
9
- export interface InboundNetworkIssueDetectorParams {
9
+ export interface InboundNetworkIssueDetectorParams extends BaseIssueDetectorParams {
10
10
highPacketLossThresholdPct ?: number ;
11
11
highJitterThreshold ?: number ;
12
12
highJitterBufferDelayThresholdMs ?: number ;
13
13
highRttThresholdMs ?: number ;
14
14
}
15
15
16
16
class InboundNetworkIssueDetector extends BaseIssueDetector {
17
- readonly highPacketLossThresholdPct : number ;
17
+ readonly # highPacketLossThresholdPct: number ;
18
18
19
- readonly highJitterThreshold : number ;
19
+ readonly # highJitterThreshold: number ;
20
20
21
- readonly highJitterBufferDelayThresholdMs : number ;
21
+ readonly # highJitterBufferDelayThresholdMs: number ;
22
22
23
- readonly highRttThresholdMs : number ;
23
+ readonly # highRttThresholdMs: number ;
24
24
25
25
constructor ( params : InboundNetworkIssueDetectorParams = { } ) {
26
26
super ( ) ;
27
- this . highPacketLossThresholdPct = params . highPacketLossThresholdPct ?? 5 ;
28
- this . highJitterThreshold = params . highJitterThreshold ?? 200 ;
29
- this . highJitterBufferDelayThresholdMs = params . highJitterBufferDelayThresholdMs ?? 500 ;
30
- this . highRttThresholdMs = params . highRttThresholdMs ?? 250 ;
27
+ this . # highPacketLossThresholdPct = params . highPacketLossThresholdPct ?? 5 ;
28
+ this . # highJitterThreshold = params . highJitterThreshold ?? 200 ;
29
+ this . # highJitterBufferDelayThresholdMs = params . highJitterBufferDelayThresholdMs ?? 500 ;
30
+ this . # highRttThresholdMs = params . highRttThresholdMs ?? 250 ;
31
31
}
32
32
33
33
performDetection ( data : WebRTCStatsParsed ) : IssueDetectorResult {
@@ -87,10 +87,10 @@ class InboundNetworkIssueDetector extends BaseIssueDetector {
87
87
? Math . round ( ( deltaPacketLost * 100 ) / ( deltaPacketReceived + deltaPacketLost ) )
88
88
: 0 ;
89
89
90
- const isHighPacketsLoss = packetLossPct > this . highPacketLossThresholdPct ;
91
- const isHighJitter = avgJitter >= this . highJitterThreshold ;
92
- const isHighRTT = rtt >= this . highRttThresholdMs ;
93
- const isHighJitterBufferDelay = avgJitterBufferDelay > this . highJitterBufferDelayThresholdMs ;
90
+ const isHighPacketsLoss = packetLossPct > this . # highPacketLossThresholdPct;
91
+ const isHighJitter = avgJitter >= this . # highJitterThreshold;
92
+ const isHighRTT = rtt >= this . # highRttThresholdMs;
93
+ const isHighJitterBufferDelay = avgJitterBufferDelay > this . # highJitterBufferDelayThresholdMs;
94
94
const isNetworkIssue = isHighJitter || isHighPacketsLoss ;
95
95
const isServerIssue = isHighRTT && ! isHighJitter && ! isHighPacketsLoss ;
96
96
const isNetworkMediaLatencyIssue = isHighPacketsLoss && isHighJitter ;
0 commit comments