@@ -4,30 +4,30 @@ import {
44 IssueType ,
55 WebRTCStatsParsed ,
66} from '../types' ;
7- import BaseIssueDetector from './BaseIssueDetector' ;
7+ import BaseIssueDetector , { BaseIssueDetectorParams } from './BaseIssueDetector' ;
88
9- export interface InboundNetworkIssueDetectorParams {
9+ export interface InboundNetworkIssueDetectorParams extends BaseIssueDetectorParams {
1010 highPacketLossThresholdPct ?: number ;
1111 highJitterThreshold ?: number ;
1212 highJitterBufferDelayThresholdMs ?: number ;
1313 highRttThresholdMs ?: number ;
1414}
1515
1616class InboundNetworkIssueDetector extends BaseIssueDetector {
17- readonly highPacketLossThresholdPct : number ;
17+ readonly # highPacketLossThresholdPct: number ;
1818
19- readonly highJitterThreshold : number ;
19+ readonly # highJitterThreshold: number ;
2020
21- readonly highJitterBufferDelayThresholdMs : number ;
21+ readonly # highJitterBufferDelayThresholdMs: number ;
2222
23- readonly highRttThresholdMs : number ;
23+ readonly # highRttThresholdMs: number ;
2424
2525 constructor ( params : InboundNetworkIssueDetectorParams = { } ) {
2626 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 ;
3131 }
3232
3333 performDetection ( data : WebRTCStatsParsed ) : IssueDetectorResult {
@@ -87,10 +87,10 @@ class InboundNetworkIssueDetector extends BaseIssueDetector {
8787 ? Math . round ( ( deltaPacketLost * 100 ) / ( deltaPacketReceived + deltaPacketLost ) )
8888 : 0 ;
8989
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;
9494 const isNetworkIssue = isHighJitter || isHighPacketsLoss ;
9595 const isServerIssue = isHighRTT && ! isHighJitter && ! isHighPacketsLoss ;
9696 const isNetworkMediaLatencyIssue = isHighPacketsLoss && isHighJitter ;
0 commit comments