@observertc/client-monitor-js 3.9.1 → 3.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/ClientMonitor.d.ts +3 -3
- package/lib/ClientMonitor.d.ts.map +1 -1
- package/lib/ClientMonitor.js +54 -39
- package/lib/detectors/AudioDesyncDetector.d.ts +5 -1
- package/lib/detectors/AudioDesyncDetector.d.ts.map +1 -1
- package/lib/detectors/AudioDesyncDetector.js +4 -0
- package/lib/detectors/CongestionDetector.d.ts +21 -3
- package/lib/detectors/CongestionDetector.d.ts.map +1 -1
- package/lib/detectors/CongestionDetector.js +52 -4
- package/lib/detectors/CpuPerformanceDetector.d.ts +4 -1
- package/lib/detectors/CpuPerformanceDetector.d.ts.map +1 -1
- package/lib/detectors/CpuPerformanceDetector.js +4 -0
- package/lib/detectors/Detector.d.ts +9 -0
- package/lib/detectors/Detector.d.ts.map +1 -0
- package/lib/detectors/Detector.js +2 -0
- package/lib/detectors/LongPcConnectionEstablishment.d.ts +5 -2
- package/lib/detectors/LongPcConnectionEstablishment.d.ts.map +1 -1
- package/lib/detectors/LongPcConnectionEstablishment.js +4 -0
- package/lib/detectors/StuckedInboundTrack.d.ts +4 -0
- package/lib/detectors/StuckedInboundTrack.d.ts.map +1 -1
- package/lib/detectors/StuckedInboundTrack.js +13 -0
- package/lib/detectors/VideoFreezesDetector.d.ts +6 -1
- package/lib/detectors/VideoFreezesDetector.d.ts.map +1 -1
- package/lib/detectors/VideoFreezesDetector.js +13 -0
- package/lib/entries/InboundTrackStats.d.ts +3 -0
- package/lib/entries/InboundTrackStats.d.ts.map +1 -1
- package/lib/entries/InboundTrackStats.js +18 -2
- package/lib/entries/OutboundTrackStats.d.ts +4 -0
- package/lib/entries/OutboundTrackStats.d.ts.map +1 -1
- package/lib/entries/OutboundTrackStats.js +19 -1
- package/lib/entries/PeerConnectionEntryManifest.js +1 -1
- package/lib/entries/StatsEntryInterfaces.d.ts +7 -1
- package/lib/entries/StatsEntryInterfaces.d.ts.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/package.json +1 -1
package/lib/ClientMonitor.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { StatsStorage } from './entries/StatsStorage';
|
|
|
4
4
|
import { TypedEventEmitter } from './utils/TypedEmitter';
|
|
5
5
|
import { PeerConnectionEntry, PeerConnectionStateUpdated, TrackStats } from './entries/StatsEntryInterfaces';
|
|
6
6
|
import { AudioDesyncDetector, AudioDesyncDetectorConfig } from './detectors/AudioDesyncDetector';
|
|
7
|
-
import { CongestionDetector } from './detectors/CongestionDetector';
|
|
7
|
+
import { CongestionDetector, CongestionDetectorConfig } from './detectors/CongestionDetector';
|
|
8
8
|
import { CpuPerformanceDetector, CpuPerformanceDetectorConfig } from './detectors/CpuPerformanceDetector';
|
|
9
9
|
import { VideoFreezesDetector, VideoFreezesDetectorConfig } from './detectors/VideoFreezesDetector';
|
|
10
10
|
import { StuckedInboundTrackDetector, StuckedInboundTrackDetectorConfig } from './detectors/StuckedInboundTrack';
|
|
@@ -12,7 +12,7 @@ import { LongPcConnectionEstablishmentDetector, LongPcConnectionEstablishmentDet
|
|
|
12
12
|
type ClientDetectorIssueDetectionExtension = {
|
|
13
13
|
severity: 'critical' | 'major' | 'minor';
|
|
14
14
|
description?: string;
|
|
15
|
-
attachments?: Record<string, unknown
|
|
15
|
+
attachments?: Record<string, unknown> | (() => Record<string, unknown>);
|
|
16
16
|
};
|
|
17
17
|
export type ClientMonitorConfig = {
|
|
18
18
|
/**
|
|
@@ -219,7 +219,7 @@ export declare class ClientMonitor extends TypedEventEmitter<ClientMonitorEvents
|
|
|
219
219
|
addIssue(issue: ClientIssue): void;
|
|
220
220
|
setCollectingPeriod(collectingPeriodInMs: number): void;
|
|
221
221
|
setSamplingTick(samplingTick: number): void;
|
|
222
|
-
createCongestionDetector(options?: {
|
|
222
|
+
createCongestionDetector(options?: CongestionDetectorConfig & {
|
|
223
223
|
createIssueOnDetection?: ClientDetectorIssueDetectionExtension;
|
|
224
224
|
}): CongestionDetector;
|
|
225
225
|
createAudioDesyncDetector(config?: AudioDesyncDetectorConfig & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientMonitor.d.ts","sourceRoot":"","sources":["../src/ClientMonitor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,YAAY,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5H,OAAO,EAAE,cAAc,EAAoB,MAAM,cAAc,CAAC;AAEhE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAIzD,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC7G,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AACjG,OAAO,EAAE,kBAAkB,EAA4B,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"ClientMonitor.d.ts","sourceRoot":"","sources":["../src/ClientMonitor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,YAAY,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5H,OAAO,EAAE,cAAc,EAAoB,MAAM,cAAc,CAAC;AAEhE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAIzD,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC7G,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AACjG,OA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;IAED,IAAW,mBAAmB,uBAE7B;IAED,IAAW,qBAAqB,uBAE/B;IAED,IAAW,qBAAqB,uBAE/B;IAED,IAAW,uBAAuB,WAEjC;IAED,IAAW,2BAA2B,WAErC;IAED,IAAW,wBAAwB,WAElC;IAED,IAAW,4BAA4B,WAEtC;IAED,IAAW,wBAAwB,WAElC;IAED,IAAW,yBAAyB,WAEnC;IAED,IAAW,6BAA6B,WAEvC;IAED,IAAW,mBAAmB,WAE7B;IAED,IAAW,mBAAmB,WAE7B;IAED,IAAW,uBAAuB,WAEjC;IAED,IAAW,uBAAuB,WAEjC;IAED,IAAW,6BAA6B,uBAEvC;IAED,IAAW,6BAA6B,uBAEvC;IAED,IAAW,uBAAuB,uBAEjC;IAED,IAAW,2BAA2B,uBAErC;IAED,IAAW,wBAAwB,uBAElC;IAED,IAAW,4BAA4B,uBAEtC;IAED,IAAW,wBAAwB,uBAElC;IAED,IAAW,yBAAyB,uBAEnC;IAED,IAAW,6BAA6B,uBAEvC;IAED,IAAW,mBAAmB,uBAE7B;IAED,IAAW,mBAAmB,uBAE7B;IAED,IAAW,uBAAuB,uBAEjC;IAED,IAAW,uBAAuB,uBAEjC;IAED,IAAW,WAAW,uBAErB;IAED,IAAW,yBAAyB,uBAEnC;IAED,IAAW,2BAA2B,uBAErC;IAED,IAAW,mCAAmC,uBAE7C;IAED,IAAW,mCAAmC,uBAE7C;IAED,IAAW,mBAAmB,uBAE7B;IAED,IAAW,qBAAqB,uBAE/B;IAED,OAAO,CAAC,eAAe;IA2DvB,OAAO,CAAC,WAAW;IAWnB,OAAO,CAAC,MAAM,CAAC,mBAAmB;WAyCpB,8BAA8B,CAAC,OAAO,EAAE,aAAa,EAAE,kBAAkB,CAAC,EAAE,YAAY;CAqEzG"}
|
package/lib/ClientMonitor.js
CHANGED
|
@@ -318,31 +318,17 @@ class ClientMonitor extends TypedEmitter_1.TypedEventEmitter {
|
|
|
318
318
|
}
|
|
319
319
|
createCongestionDetector(options) {
|
|
320
320
|
const existingDetector = this._detectors.get(CongestionDetector_1.CongestionDetector.name);
|
|
321
|
-
const { createIssueOnDetection, } = options ?? {
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
321
|
+
const { createIssueOnDetection, ...detectorConfig } = options ?? {
|
|
322
|
+
sensitivity: 'high',
|
|
323
|
+
};
|
|
324
|
+
if (existingDetector) {
|
|
325
|
+
logger.warn('CongestionDetector is already created, closing the existing one and creating a new one.');
|
|
326
|
+
existingDetector.close();
|
|
327
|
+
}
|
|
328
|
+
const detector = new CongestionDetector_1.CongestionDetector(detectorConfig);
|
|
325
329
|
const onUpdate = () => detector.update(this.storage.peerConnections());
|
|
326
330
|
const onCongestion = (...event) => {
|
|
327
|
-
const
|
|
328
|
-
let incomingBitrateAfterCongestion;
|
|
329
|
-
let incomingBitrateBeforeCongestion;
|
|
330
|
-
let outgoingBitrateAfterCongestion;
|
|
331
|
-
let outgoingBitrateBeforeCongestion;
|
|
332
|
-
for (const state of peerConnectionStates) {
|
|
333
|
-
if (state.incomingBitrateAfterCongestion) {
|
|
334
|
-
incomingBitrateAfterCongestion = (incomingBitrateAfterCongestion ?? 0) + state.incomingBitrateAfterCongestion;
|
|
335
|
-
}
|
|
336
|
-
if (state.incomingBitrateBeforeCongestion) {
|
|
337
|
-
incomingBitrateBeforeCongestion = (incomingBitrateBeforeCongestion ?? 0) + state.incomingBitrateBeforeCongestion;
|
|
338
|
-
}
|
|
339
|
-
if (state.outgoingBitrateAfterCongestion) {
|
|
340
|
-
outgoingBitrateAfterCongestion = (outgoingBitrateAfterCongestion ?? 0) + state.outgoingBitrateAfterCongestion;
|
|
341
|
-
}
|
|
342
|
-
if (state.outgoingBitrateBeforeCongestion) {
|
|
343
|
-
outgoingBitrateBeforeCongestion = (outgoingBitrateBeforeCongestion ?? 0) + state.outgoingBitrateBeforeCongestion;
|
|
344
|
-
}
|
|
345
|
-
}
|
|
331
|
+
const { incomingBitrateAfterCongestion, incomingBitrateBeforeCongestion, outgoingBitrateAfterCongestion, outgoingBitrateBeforeCongestion, } = event[0];
|
|
346
332
|
this.emit('congestion', {
|
|
347
333
|
incomingBitrateAfterCongestion,
|
|
348
334
|
incomingBitrateBeforeCongestion,
|
|
@@ -350,12 +336,15 @@ class ClientMonitor extends TypedEmitter_1.TypedEventEmitter {
|
|
|
350
336
|
outgoingBitrateBeforeCongestion,
|
|
351
337
|
});
|
|
352
338
|
if (createIssueOnDetection) {
|
|
339
|
+
const attachments = (typeof createIssueOnDetection.attachments === 'function'
|
|
340
|
+
? createIssueOnDetection.attachments()
|
|
341
|
+
: createIssueOnDetection.attachments) ?? {};
|
|
353
342
|
this.addIssue({
|
|
354
343
|
severity: createIssueOnDetection.severity,
|
|
355
344
|
description: createIssueOnDetection.description ?? 'Congestion detected',
|
|
356
345
|
timestamp: Date.now(),
|
|
357
346
|
attachments: {
|
|
358
|
-
...
|
|
347
|
+
...attachments,
|
|
359
348
|
incomingBitrateAfterCongestion,
|
|
360
349
|
incomingBitrateBeforeCongestion,
|
|
361
350
|
outgoingBitrateAfterCongestion,
|
|
@@ -376,8 +365,10 @@ class ClientMonitor extends TypedEmitter_1.TypedEventEmitter {
|
|
|
376
365
|
}
|
|
377
366
|
createAudioDesyncDetector(config) {
|
|
378
367
|
const existingDetector = this._detectors.get(AudioDesyncDetector_1.AudioDesyncDetector.name);
|
|
379
|
-
if (existingDetector)
|
|
380
|
-
|
|
368
|
+
if (existingDetector) {
|
|
369
|
+
logger.warn('AudioDesyncDetector is already created, closing the existing one and creating a new one.');
|
|
370
|
+
existingDetector.close();
|
|
371
|
+
}
|
|
381
372
|
const detector = new AudioDesyncDetector_1.AudioDesyncDetector({
|
|
382
373
|
fractionalCorrectionAlertOnThreshold: config?.fractionalCorrectionAlertOnThreshold ?? 0.1,
|
|
383
374
|
fractionalCorrectionAlertOffThreshold: config?.fractionalCorrectionAlertOffThreshold ?? 0.05,
|
|
@@ -388,13 +379,16 @@ class ClientMonitor extends TypedEmitter_1.TypedEventEmitter {
|
|
|
388
379
|
// this.emit('audio-desync', 'on');
|
|
389
380
|
if (!createIssueOnDetection)
|
|
390
381
|
return;
|
|
382
|
+
const attachments = typeof createIssueOnDetection.attachments === 'function'
|
|
383
|
+
? createIssueOnDetection.attachments()
|
|
384
|
+
: createIssueOnDetection.attachments;
|
|
391
385
|
this.addIssue({
|
|
392
386
|
severity: createIssueOnDetection.severity,
|
|
393
387
|
description: createIssueOnDetection.description ?? 'Audio desync detected',
|
|
394
388
|
timestamp: Date.now(),
|
|
395
389
|
peerConnectionId: this.storage.getTrack(trackId)?.getPeerConnection()?.peerConnectionId,
|
|
396
390
|
mediaTrackId: trackId,
|
|
397
|
-
attachments
|
|
391
|
+
attachments,
|
|
398
392
|
});
|
|
399
393
|
};
|
|
400
394
|
const onSync = () => {
|
|
@@ -414,8 +408,10 @@ class ClientMonitor extends TypedEmitter_1.TypedEventEmitter {
|
|
|
414
408
|
}
|
|
415
409
|
createVideoFreezesDetector(config) {
|
|
416
410
|
const existingDetector = this._detectors.get(VideoFreezesDetector_1.VideoFreezesDetector.name);
|
|
417
|
-
if (existingDetector)
|
|
418
|
-
|
|
411
|
+
if (existingDetector) {
|
|
412
|
+
logger.warn('VideoFreezesDetector is already created, closing the existing one and creating a new one.');
|
|
413
|
+
existingDetector.close();
|
|
414
|
+
}
|
|
419
415
|
const detector = new VideoFreezesDetector_1.VideoFreezesDetector({});
|
|
420
416
|
const onUpdate = () => detector.update(this.storage.inboundRtps());
|
|
421
417
|
const { createIssueOnDetection, } = config ?? {};
|
|
@@ -429,6 +425,9 @@ class ClientMonitor extends TypedEmitter_1.TypedEventEmitter {
|
|
|
429
425
|
};
|
|
430
426
|
const onFreezeEnded = (event) => {
|
|
431
427
|
if (createIssueOnDetection) {
|
|
428
|
+
const attachments = (typeof createIssueOnDetection.attachments === 'function'
|
|
429
|
+
? createIssueOnDetection.attachments()
|
|
430
|
+
: createIssueOnDetection.attachments) ?? {};
|
|
432
431
|
this.addIssue({
|
|
433
432
|
severity: createIssueOnDetection.severity,
|
|
434
433
|
description: createIssueOnDetection.description ?? 'Video Freeze detected',
|
|
@@ -437,7 +436,7 @@ class ClientMonitor extends TypedEmitter_1.TypedEventEmitter {
|
|
|
437
436
|
mediaTrackId: event.trackId,
|
|
438
437
|
attachments: {
|
|
439
438
|
durationInS: event.durationInS,
|
|
440
|
-
...
|
|
439
|
+
...attachments
|
|
441
440
|
},
|
|
442
441
|
});
|
|
443
442
|
}
|
|
@@ -462,19 +461,24 @@ class ClientMonitor extends TypedEmitter_1.TypedEventEmitter {
|
|
|
462
461
|
}
|
|
463
462
|
createCpuPerformanceIssueDetector(config) {
|
|
464
463
|
const existingDetector = this._detectors.get(CpuPerformanceDetector_1.CpuPerformanceDetector.name);
|
|
465
|
-
if (existingDetector)
|
|
466
|
-
|
|
464
|
+
if (existingDetector) {
|
|
465
|
+
logger.warn('CpuPerformanceDetector is already created, closing the existing one and creating a new one.');
|
|
466
|
+
existingDetector.close();
|
|
467
|
+
}
|
|
467
468
|
const detector = new CpuPerformanceDetector_1.CpuPerformanceDetector(config ?? {});
|
|
468
469
|
const onUpdate = () => detector.update(this.storage.peerConnections());
|
|
469
470
|
const { createIssueOnDetection, } = config ?? {};
|
|
470
471
|
const onStateChanged = (state) => {
|
|
471
472
|
this.emit('cpulimitation', state);
|
|
472
473
|
if (createIssueOnDetection && state !== 'on') {
|
|
474
|
+
const attachments = typeof createIssueOnDetection.attachments === 'function'
|
|
475
|
+
? createIssueOnDetection.attachments()
|
|
476
|
+
: createIssueOnDetection.attachments;
|
|
473
477
|
this.addIssue({
|
|
474
478
|
severity: createIssueOnDetection.severity,
|
|
475
479
|
description: createIssueOnDetection.description ?? 'Audio desync detected',
|
|
476
480
|
timestamp: Date.now(),
|
|
477
|
-
attachments
|
|
481
|
+
attachments,
|
|
478
482
|
});
|
|
479
483
|
}
|
|
480
484
|
};
|
|
@@ -490,8 +494,10 @@ class ClientMonitor extends TypedEmitter_1.TypedEventEmitter {
|
|
|
490
494
|
}
|
|
491
495
|
createStuckedInboundTrackDetector(config) {
|
|
492
496
|
const existingDetector = this._detectors.get(StuckedInboundTrack_1.StuckedInboundTrackDetector.name);
|
|
493
|
-
if (existingDetector)
|
|
494
|
-
|
|
497
|
+
if (existingDetector) {
|
|
498
|
+
logger.warn('StuckedInboundTrackDetector is already created, closing the existing one and creating a new one.');
|
|
499
|
+
existingDetector.close();
|
|
500
|
+
}
|
|
495
501
|
const detector = new StuckedInboundTrack_1.StuckedInboundTrackDetector(config ?? {
|
|
496
502
|
minStuckedDurationInMs: 5000,
|
|
497
503
|
});
|
|
@@ -499,6 +505,9 @@ class ClientMonitor extends TypedEmitter_1.TypedEventEmitter {
|
|
|
499
505
|
const { createIssueOnDetection, } = config ?? {};
|
|
500
506
|
const onStuckedTrack = (event) => {
|
|
501
507
|
if (createIssueOnDetection) {
|
|
508
|
+
const attachments = (typeof createIssueOnDetection.attachments === 'function'
|
|
509
|
+
? createIssueOnDetection.attachments()
|
|
510
|
+
: createIssueOnDetection.attachments) ?? {};
|
|
502
511
|
this.addIssue({
|
|
503
512
|
severity: createIssueOnDetection.severity,
|
|
504
513
|
description: createIssueOnDetection.description ?? 'Stucked track detected',
|
|
@@ -507,7 +516,7 @@ class ClientMonitor extends TypedEmitter_1.TypedEventEmitter {
|
|
|
507
516
|
mediaTrackId: event.trackId,
|
|
508
517
|
attachments: {
|
|
509
518
|
ssrc: event.ssrc,
|
|
510
|
-
...
|
|
519
|
+
...attachments,
|
|
511
520
|
},
|
|
512
521
|
});
|
|
513
522
|
}
|
|
@@ -529,20 +538,25 @@ class ClientMonitor extends TypedEmitter_1.TypedEventEmitter {
|
|
|
529
538
|
}
|
|
530
539
|
createLongPcConnectionEstablishmentDetector(config) {
|
|
531
540
|
const existingDetector = this._detectors.get(LongPcConnectionEstablishment_1.LongPcConnectionEstablishmentDetector.name);
|
|
532
|
-
if (existingDetector)
|
|
533
|
-
|
|
541
|
+
if (existingDetector) {
|
|
542
|
+
logger.warn('LongPcConnectionEstablishmentDetector is already created, closing the existing one and creating a new one.');
|
|
543
|
+
existingDetector.close();
|
|
544
|
+
}
|
|
534
545
|
const detector = new LongPcConnectionEstablishment_1.LongPcConnectionEstablishmentDetector(config ?? {
|
|
535
546
|
thresholdInMs: 3000,
|
|
536
547
|
}, this);
|
|
537
548
|
const { createIssueOnDetection, } = config ?? {};
|
|
538
549
|
const onLongConnection = (event) => {
|
|
539
550
|
if (createIssueOnDetection) {
|
|
551
|
+
const attachments = (typeof createIssueOnDetection.attachments === 'function'
|
|
552
|
+
? createIssueOnDetection.attachments()
|
|
553
|
+
: createIssueOnDetection.attachments);
|
|
540
554
|
this.addIssue({
|
|
541
555
|
severity: createIssueOnDetection.severity,
|
|
542
556
|
description: createIssueOnDetection.description ?? 'Long peer connection establishment detected',
|
|
543
557
|
timestamp: Date.now(),
|
|
544
558
|
peerConnectionId: event.peerConnectionId,
|
|
545
|
-
attachments
|
|
559
|
+
attachments,
|
|
546
560
|
});
|
|
547
561
|
}
|
|
548
562
|
this.emit('too-long-pc-connection-establishment', {
|
|
@@ -743,6 +757,7 @@ class ClientMonitor extends TypedEmitter_1.TypedEventEmitter {
|
|
|
743
757
|
};
|
|
744
758
|
if (settings.congestion) {
|
|
745
759
|
this.createCongestionDetector({
|
|
760
|
+
sensitivity: 'high',
|
|
746
761
|
createIssueOnDetection: getCreateIssueOnDetection('congestion'),
|
|
747
762
|
});
|
|
748
763
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import EventEmitter from "events";
|
|
3
|
+
import { AlertState } from "../ClientMonitor";
|
|
3
4
|
import { InboundRtpEntry } from "../entries/StatsEntryInterfaces";
|
|
5
|
+
import { Detector } from "./Detector";
|
|
4
6
|
/**
|
|
5
7
|
* Configuration object for the AudioDesyncDetector function.
|
|
6
8
|
*/
|
|
@@ -23,6 +25,7 @@ export type AudioDesyncDetectorConfig = {
|
|
|
23
25
|
fractionalCorrectionAlertOffThreshold: number;
|
|
24
26
|
};
|
|
25
27
|
export type AudioDesyncDetectorEvents = {
|
|
28
|
+
'alert-state': [AlertState];
|
|
26
29
|
desync: [string];
|
|
27
30
|
sync: [string];
|
|
28
31
|
statechanged: [{
|
|
@@ -31,7 +34,7 @@ export type AudioDesyncDetectorEvents = {
|
|
|
31
34
|
}];
|
|
32
35
|
close: [];
|
|
33
36
|
};
|
|
34
|
-
export declare interface AudioDesyncDetector {
|
|
37
|
+
export declare interface AudioDesyncDetector extends Detector {
|
|
35
38
|
on<K extends keyof AudioDesyncDetectorEvents>(event: K, listener: (...events: AudioDesyncDetectorEvents[K]) => void): this;
|
|
36
39
|
off<K extends keyof AudioDesyncDetectorEvents>(event: K, listener: (...events: AudioDesyncDetectorEvents[K]) => void): this;
|
|
37
40
|
once<K extends keyof AudioDesyncDetectorEvents>(event: K, listener: (...events: AudioDesyncDetectorEvents[K]) => void): this;
|
|
@@ -42,6 +45,7 @@ export declare class AudioDesyncDetector extends EventEmitter {
|
|
|
42
45
|
private _closed;
|
|
43
46
|
private readonly _states;
|
|
44
47
|
constructor(config: AudioDesyncDetectorConfig);
|
|
48
|
+
get closed(): boolean;
|
|
45
49
|
close(): void;
|
|
46
50
|
update(inboundRtps: IterableIterator<InboundRtpEntry>): void;
|
|
47
51
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AudioDesyncDetector.d.ts","sourceRoot":"","sources":["../../src/detectors/AudioDesyncDetector.ts"],"names":[],"mappings":";AAAA,OAAO,YAAY,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"AudioDesyncDetector.d.ts","sourceRoot":"","sources":["../../src/detectors/AudioDesyncDetector.ts"],"names":[],"mappings":";AAAA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,UAAU,EAAiB,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM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KnD,OAAO,CAAC,QAAQ,CAAC,MAAM;IAJxB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAqC;gBAG3C,MAAM,EAAE,yBAAyB;IAOnD,IAAW,MAAM,YAEhB;IAEM,KAAK;IAQL,MAAM,CAAC,WAAW,EAAE,gBAAgB,CAAC,eAAe,CAAC;CAsD5D"}
|
|
@@ -13,6 +13,9 @@ class AudioDesyncDetector extends events_1.default {
|
|
|
13
13
|
this._states = new Map();
|
|
14
14
|
this.setMaxListeners(Infinity);
|
|
15
15
|
}
|
|
16
|
+
get closed() {
|
|
17
|
+
return this._closed;
|
|
18
|
+
}
|
|
16
19
|
close() {
|
|
17
20
|
if (this._closed)
|
|
18
21
|
return;
|
|
@@ -58,6 +61,7 @@ class AudioDesyncDetector extends events_1.default {
|
|
|
58
61
|
const actualState = state.desync ? 'desync' : 'sync';
|
|
59
62
|
this.emit(actualState, trackId);
|
|
60
63
|
this.emit('statechanged', { trackId, state: actualState });
|
|
64
|
+
actualState === 'desync' ? this.emit('alert-state', 'on') : this.emit('alert-state', 'off');
|
|
61
65
|
}
|
|
62
66
|
}
|
|
63
67
|
}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import EventEmitter from "events";
|
|
3
3
|
import { PeerConnectionEntry } from "../entries/StatsEntryInterfaces";
|
|
4
|
+
import { Detector } from "./Detector";
|
|
5
|
+
import { AlertState } from "../ClientMonitor";
|
|
4
6
|
type PeerConnectionState = {
|
|
5
7
|
peerConnectionId: string;
|
|
8
|
+
ewmaRttInS?: number;
|
|
9
|
+
ewmaFl?: number;
|
|
6
10
|
congested: boolean;
|
|
7
11
|
outgoingBitrateBeforeCongestion?: number;
|
|
8
12
|
outgoingBitrateAfterCongestion?: number;
|
|
@@ -10,21 +14,35 @@ type PeerConnectionState = {
|
|
|
10
14
|
incomingBitrateAfterCongestion?: number;
|
|
11
15
|
};
|
|
12
16
|
export type CongestionDetectorEvents = {
|
|
13
|
-
|
|
17
|
+
'alert-state': [AlertState];
|
|
18
|
+
congestion: [
|
|
19
|
+
{
|
|
20
|
+
peerConnectionIds: string[];
|
|
21
|
+
outgoingBitrateBeforeCongestion?: number;
|
|
22
|
+
outgoingBitrateAfterCongestion?: number;
|
|
23
|
+
incomingBitrateBeforeCongestion?: number;
|
|
24
|
+
incomingBitrateAfterCongestion?: number;
|
|
25
|
+
}
|
|
26
|
+
];
|
|
14
27
|
close: [];
|
|
15
28
|
};
|
|
16
|
-
export
|
|
29
|
+
export type CongestionDetectorConfig = {
|
|
30
|
+
sensitivity: 'high' | 'medium' | 'low';
|
|
31
|
+
};
|
|
32
|
+
export declare interface CongestionDetector extends Detector {
|
|
17
33
|
on<K extends keyof CongestionDetectorEvents>(event: K, listener: (...events: CongestionDetectorEvents[K]) => void): this;
|
|
18
34
|
off<K extends keyof CongestionDetectorEvents>(event: K, listener: (...events: CongestionDetectorEvents[K]) => void): this;
|
|
19
35
|
once<K extends keyof CongestionDetectorEvents>(event: K, listener: (...events: CongestionDetectorEvents[K]) => void): this;
|
|
20
36
|
emit<K extends keyof CongestionDetectorEvents>(event: K, ...events: CongestionDetectorEvents[K]): boolean;
|
|
21
37
|
}
|
|
22
38
|
export declare class CongestionDetector extends EventEmitter {
|
|
39
|
+
readonly config: CongestionDetectorConfig;
|
|
23
40
|
private _closed;
|
|
24
41
|
private _states;
|
|
25
|
-
constructor();
|
|
42
|
+
constructor(config: CongestionDetectorConfig);
|
|
26
43
|
get states(): ReadonlyMap<string, PeerConnectionState>;
|
|
27
44
|
update(peerConnections: IterableIterator<PeerConnectionEntry>): void;
|
|
45
|
+
get closed(): boolean;
|
|
28
46
|
close(): void;
|
|
29
47
|
}
|
|
30
48
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CongestionDetector.d.ts","sourceRoot":"","sources":["../../src/detectors/CongestionDetector.ts"],"names":[],"mappings":";AAAA,OAAO,YAAY,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AwB,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,MAAM,EAAE,wBAAwB,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,IAAI,CAAC;IACzH,GAAG,CAAC,CAAC,SAAS,MAAM,wBAAwB,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,MAAM,EAAE,wBAAwB,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,IAAI,CAAC;IAC1H,IAAI,CAAC,CAAC,SAAS,MAAM,wBAAwB,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,MAAM,EAAE,wBAAwB,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,IAAI,CAAC;IAC3H,IAAI,CAAC,CAAC,SAAS,MAAM,wBAAwB,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,MAAM,EAAE,wBAAwB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC;CAC1G;AAED,qBAAa,kBAAmB,SAAQ,YAAY;aAKlC,MAAM,EAAE,wBAAwB;IAJjD,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,OAAO,CAA0C;gBAGxC,MAAM,EAAE,wBAAwB;IAMjD,IAAW,MAAM,IAAI,WAAW,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAE5D;IAEM,MAAM,CAAC,eAAe,EAAE,gBAAgB,CAAC,mBAAmB,CAAC;IAyHpE,IAAW,MAAM,YAEhB;IAEM,KAAK;CAMZ"}
|
|
@@ -6,8 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.CongestionDetector = void 0;
|
|
7
7
|
const events_1 = __importDefault(require("events"));
|
|
8
8
|
class CongestionDetector extends events_1.default {
|
|
9
|
-
constructor() {
|
|
9
|
+
constructor(config) {
|
|
10
10
|
super();
|
|
11
|
+
this.config = config;
|
|
11
12
|
this._closed = false;
|
|
12
13
|
this._states = new Map();
|
|
13
14
|
this.setMaxListeners(Infinity);
|
|
@@ -34,10 +35,41 @@ class CongestionDetector extends events_1.default {
|
|
|
34
35
|
this._states.set(peerConnectionId, state);
|
|
35
36
|
}
|
|
36
37
|
const wasCongested = state.congested;
|
|
37
|
-
let
|
|
38
|
+
let hasBwLimitedOutboundRtp = false;
|
|
38
39
|
for (const outboundRtp of peerConnection.outboundRtps()) {
|
|
39
|
-
|
|
40
|
+
hasBwLimitedOutboundRtp || (hasBwLimitedOutboundRtp = outboundRtp.stats.qualityLimitationReason === 'bandwidth');
|
|
41
|
+
// isCongested ||= outboundRtp.stats.qualityLimitationReason === 'bandwidth';
|
|
42
|
+
}
|
|
43
|
+
let rttDiffInS = 0;
|
|
44
|
+
if (peerConnection.avgRttInS !== undefined) {
|
|
45
|
+
if (state.ewmaRttInS === undefined) {
|
|
46
|
+
state.ewmaRttInS = peerConnection.avgRttInS;
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
state.ewmaRttInS = 0.9 * state.ewmaRttInS + 0.1 * peerConnection.avgRttInS;
|
|
50
|
+
}
|
|
51
|
+
rttDiffInS = Math.abs(peerConnection.avgRttInS - state.ewmaRttInS);
|
|
40
52
|
}
|
|
53
|
+
let isCongested = false;
|
|
54
|
+
switch (this.config.sensitivity) {
|
|
55
|
+
case 'high':
|
|
56
|
+
isCongested = hasBwLimitedOutboundRtp;
|
|
57
|
+
break;
|
|
58
|
+
case 'medium': {
|
|
59
|
+
if (!state.ewmaRttInS)
|
|
60
|
+
break;
|
|
61
|
+
const rttDiffThreshold = Math.min(0.15, Math.max(0.05, state.ewmaRttInS * 0.33));
|
|
62
|
+
isCongested = hasBwLimitedOutboundRtp && rttDiffInS > rttDiffThreshold;
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
case 'low': {
|
|
66
|
+
if (!state.ewmaRttInS || !peerConnection.sendingFractionalLoss)
|
|
67
|
+
break;
|
|
68
|
+
isCongested = hasBwLimitedOutboundRtp && peerConnection.sendingFractionalLoss > 0.05;
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
peerConnection.sendingFractionalLoss;
|
|
41
73
|
let selectedCandidatePair;
|
|
42
74
|
for (const transport of peerConnection.transports()) {
|
|
43
75
|
selectedCandidatePair = transport.getSelectedIceCandidatePair();
|
|
@@ -71,15 +103,31 @@ class CongestionDetector extends events_1.default {
|
|
|
71
103
|
}
|
|
72
104
|
else if (!wasCongested && isCongested) {
|
|
73
105
|
gotCongested = true;
|
|
106
|
+
this.emit('alert-state', 'on');
|
|
74
107
|
}
|
|
108
|
+
else if (wasCongested && !isCongested) {
|
|
109
|
+
this.emit('alert-state', 'off');
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
if (gotCongested) {
|
|
113
|
+
this.emit('congestion', {
|
|
114
|
+
peerConnectionIds: Array.from(this._states.values()).filter(s => s.congested).map(s => s.peerConnectionId),
|
|
115
|
+
incomingBitrateAfterCongestion: Array.from(this._states.values()).reduce((acc, s) => acc + (s.incomingBitrateAfterCongestion ?? 0), 0),
|
|
116
|
+
outgoingBitrateAfterCongestion: Array.from(this._states.values()).reduce((acc, s) => acc + (s.outgoingBitrateAfterCongestion ?? 0), 0),
|
|
117
|
+
incomingBitrateBeforeCongestion: Array.from(this._states.values()).reduce((acc, s) => acc + (s.incomingBitrateBeforeCongestion ?? 0), 0),
|
|
118
|
+
outgoingBitrateBeforeCongestion: Array.from(this._states.values()).reduce((acc, s) => acc + (s.outgoingBitrateBeforeCongestion ?? 0), 0),
|
|
119
|
+
});
|
|
75
120
|
}
|
|
76
|
-
gotCongested && this.emit('congestion', Array.from(this._states.values()));
|
|
121
|
+
// gotCongested && this.emit('congestion', Array.from(this._states.values()));
|
|
77
122
|
for (const [peerConnectionId] of Array.from(this._states)) {
|
|
78
123
|
if (!visitedPeerConnectionIds.has(peerConnectionId)) {
|
|
79
124
|
this._states.delete(peerConnectionId);
|
|
80
125
|
}
|
|
81
126
|
}
|
|
82
127
|
}
|
|
128
|
+
get closed() {
|
|
129
|
+
return this._closed;
|
|
130
|
+
}
|
|
83
131
|
close() {
|
|
84
132
|
if (this._closed)
|
|
85
133
|
return;
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
import EventEmitter from "events";
|
|
3
3
|
import { AlertState } from "../ClientMonitor";
|
|
4
4
|
import { PeerConnectionEntry } from "../entries/StatsEntryInterfaces";
|
|
5
|
+
import { Detector } from "./Detector";
|
|
5
6
|
export type CpuPerformanceDetectorConfig = {};
|
|
6
7
|
export type CpuPerformanceDetectorEvents = {
|
|
8
|
+
'alert-state': [AlertState];
|
|
7
9
|
statechanged: [AlertState];
|
|
8
10
|
close: [];
|
|
9
11
|
};
|
|
10
|
-
export declare interface CpuPerformanceDetector {
|
|
12
|
+
export declare interface CpuPerformanceDetector extends Detector {
|
|
11
13
|
on<K extends keyof CpuPerformanceDetectorEvents>(event: K, listener: (...events: CpuPerformanceDetectorEvents[K]) => void): this;
|
|
12
14
|
off<K extends keyof CpuPerformanceDetectorEvents>(event: K, listener: (...events: CpuPerformanceDetectorEvents[K]) => void): this;
|
|
13
15
|
once<K extends keyof CpuPerformanceDetectorEvents>(event: K, listener: (...events: CpuPerformanceDetectorEvents[K]) => void): this;
|
|
@@ -19,6 +21,7 @@ export declare class CpuPerformanceDetector extends EventEmitter {
|
|
|
19
21
|
private _alertState;
|
|
20
22
|
constructor(config: CpuPerformanceDetectorConfig);
|
|
21
23
|
update(peerConnections: IterableIterator<PeerConnectionEntry>): void;
|
|
24
|
+
get closed(): boolean;
|
|
22
25
|
close(): void;
|
|
23
26
|
}
|
|
24
27
|
//# sourceMappingURL=CpuPerformanceDetector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CpuPerformanceDetector.d.ts","sourceRoot":"","sources":["../../src/detectors/CpuPerformanceDetector.ts"],"names":[],"mappings":";AAAA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAk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AC,CAAC,GAAG,OAAO,CAAC;CAClH;AAED,qBAAa,sBAAuB,SAAQ,YAAY;aAKtC,MAAM,EAAE,4BAA4B;IAJrD,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,WAAW,CAAqB;gBAGvB,MAAM,EAAE,4BAA4B;IAO9C,MAAM,CAAC,eAAe,EAAE,gBAAgB,CAAC,mBAAmB,CAAC;IAkBpE,IAAW,MAAM,YAEhB;IAEM,KAAK;CAKZ"}
|
|
@@ -24,8 +24,12 @@ class CpuPerformanceDetector extends events_1.default {
|
|
|
24
24
|
this._alertState = gotLimited ? 'on' : 'off';
|
|
25
25
|
if (wasLimited !== gotLimited) {
|
|
26
26
|
this.emit('statechanged', this._alertState);
|
|
27
|
+
this.emit('alert-state', this._alertState);
|
|
27
28
|
}
|
|
28
29
|
}
|
|
30
|
+
get closed() {
|
|
31
|
+
return this._closed;
|
|
32
|
+
}
|
|
29
33
|
close() {
|
|
30
34
|
if (this._closed)
|
|
31
35
|
return;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AlertState } from "../ClientMonitor";
|
|
2
|
+
export interface Detector {
|
|
3
|
+
readonly closed: boolean;
|
|
4
|
+
once(event: 'close', listener: () => void): this;
|
|
5
|
+
on(event: 'alert-state', listener: (state: AlertState) => void): this;
|
|
6
|
+
off(event: 'alert-state', listener: (state: AlertState) => void): this;
|
|
7
|
+
close(): void;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=Detector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Detector.d.ts","sourceRoot":"","sources":["../../src/detectors/Detector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,MAAM,WAAW,QAAQ;IACrB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IACjD,EAAE,CAAC,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GAAG,IAAI,CAAC;IACtE,GAAG,CAAC,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GAAG,IAAI,CAAC;IACvE,KAAK,IAAI,IAAI,CAAC;CACjB"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { EventEmitter } from "events";
|
|
3
|
-
import { ClientMonitor } from "../ClientMonitor";
|
|
3
|
+
import { AlertState, ClientMonitor } from "../ClientMonitor";
|
|
4
|
+
import { Detector } from "./Detector";
|
|
4
5
|
export type LongPcConnectionEstablishmentDetectorConfig = {
|
|
5
6
|
thresholdInMs: number;
|
|
6
7
|
};
|
|
7
8
|
export type LongPcConnectionEstablishmentDetectorEvent = {
|
|
9
|
+
'alert-state': [AlertState];
|
|
8
10
|
'too-long-connection-establishment': [
|
|
9
11
|
{
|
|
10
12
|
peerConnectionId: string;
|
|
@@ -12,7 +14,7 @@ export type LongPcConnectionEstablishmentDetectorEvent = {
|
|
|
12
14
|
];
|
|
13
15
|
close: [];
|
|
14
16
|
};
|
|
15
|
-
export declare interface LongPcConnectionEstablishmentDetector {
|
|
17
|
+
export declare interface LongPcConnectionEstablishmentDetector extends Detector {
|
|
16
18
|
on<K extends keyof LongPcConnectionEstablishmentDetectorEvent>(event: K, listener: (...events: LongPcConnectionEstablishmentDetectorEvent[K]) => void): this;
|
|
17
19
|
off<K extends keyof LongPcConnectionEstablishmentDetectorEvent>(event: K, listener: (...events: LongPcConnectionEstablishmentDetectorEvent[K]) => void): this;
|
|
18
20
|
once<K extends keyof LongPcConnectionEstablishmentDetectorEvent>(event: K, listener: (...events: LongPcConnectionEstablishmentDetectorEvent[K]) => void): this;
|
|
@@ -25,6 +27,7 @@ export declare class LongPcConnectionEstablishmentDetector extends EventEmitter
|
|
|
25
27
|
private _listeners;
|
|
26
28
|
private _destroyCb;
|
|
27
29
|
constructor(config: LongPcConnectionEstablishmentDetectorConfig, monitor: ClientMonitor);
|
|
30
|
+
get closed(): boolean;
|
|
28
31
|
close(): void;
|
|
29
32
|
}
|
|
30
33
|
//# sourceMappingURL=LongPcConnectionEstablishment.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LongPcConnectionEstablishment.d.ts","sourceRoot":"","sources":["../../src/detectors/LongPcConnectionEstablishment.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"LongPcConnectionEstablishment.d.ts","sourceRoot":"","sources":["../../src/detectors/LongPcConnectionEstablishment.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,MAAM,2CAA2C,GAAG;IAEzD,aAAa,EAAE,MAAM,CAAC;CACtB,CAAA;AAED,MAAM,MAAM,0CAA0C,GAAG;IACxD,aAAa,EAAE,CAAC,UAAU,CAAC,CAAC;IAC5B,mCAAmC,EAAE;QAAC;YACrC,gBAAgB,EAAE,MAAM,CAAC;SACzB;KAAC,CAAC;IACH,KAAK,EAAE,EAAE,CAAC;CACV,CAAA;AAED,MAAM,CAAC,OAAO,WAAW,qCAAsC,SAAQ,QAAQ;IAC9E,EAAE,CAAC,CAAC,SAAS,MAAM,0CAA0C,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,MAAM,EAAE,0CAA0C,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,IAAI,CAAC;IAC7J,GAAG,CAAC,CAAC,SAAS,MAAM,0CAA0C,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,MAAM,EAAE,0CAA0C,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,IAAI,CAAC;IAC9J,IAAI,CAAC,CAAC,SAAS,MAAM,0CAA0C,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,MAAM,EAAE,0CAA0C,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,IAAI,CAAC;IAC/J,IAAI,CAAC,CAAC,SAAS,MAAM,0CAA0C,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,MAAM,EAAE,0CAA0C,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC;CAC9I;AAED,qBAAa,qCAAsC,SAAQ,YAAY;aAOrD,MAAM,EAAE,2CAA2C;IANpE,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,OAAO,CAAoD;IACnE,OAAO,CAAC,UAAU,CAAiC;IACnD,OAAO,CAAC,UAAU,CAAa;gBAGd,MAAM,EAAE,2CAA2C,EACnE,OAAO,EAAE,aAAa;IAgEvB,IAAW,MAAM,YAEhB;IAEM,KAAK;CAOZ"}
|
|
@@ -27,6 +27,7 @@ class LongPcConnectionEstablishmentDetector extends events_1.EventEmitter {
|
|
|
27
27
|
this.emit('too-long-connection-establishment', {
|
|
28
28
|
peerConnectionId: peerConnectionEntry.peerConnectionId,
|
|
29
29
|
});
|
|
30
|
+
this.emit('alert-state', 'on');
|
|
30
31
|
}, config.thresholdInMs));
|
|
31
32
|
prevState = state;
|
|
32
33
|
};
|
|
@@ -57,6 +58,9 @@ class LongPcConnectionEstablishmentDetector extends events_1.EventEmitter {
|
|
|
57
58
|
onPeerConnectionAdded(peerConnectionEntry);
|
|
58
59
|
}
|
|
59
60
|
}
|
|
61
|
+
get closed() {
|
|
62
|
+
return this._closed;
|
|
63
|
+
}
|
|
60
64
|
close() {
|
|
61
65
|
if (this._closed)
|
|
62
66
|
return;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { EventEmitter } from "events";
|
|
3
3
|
import { InboundRtpEntry } from "../entries/StatsEntryInterfaces";
|
|
4
|
+
import { AlertState } from "../ClientMonitor";
|
|
4
5
|
export type StuckedInboundTrackDetectorConfig = {
|
|
5
6
|
minStuckedDurationInMs: number;
|
|
6
7
|
};
|
|
@@ -11,6 +12,7 @@ export type InboundRtpStatsTrace = {
|
|
|
11
12
|
reported: boolean;
|
|
12
13
|
};
|
|
13
14
|
export type InboundRtpStuckedEvent = {
|
|
15
|
+
'alert-state': [AlertState];
|
|
14
16
|
stuckedtrack: [
|
|
15
17
|
{
|
|
16
18
|
peerConnectionId: string;
|
|
@@ -29,10 +31,12 @@ export declare interface StuckedInboundTrackDetector {
|
|
|
29
31
|
export declare class StuckedInboundTrackDetector extends EventEmitter {
|
|
30
32
|
readonly config: StuckedInboundTrackDetectorConfig;
|
|
31
33
|
private _closed;
|
|
34
|
+
private _stuckedTracks;
|
|
32
35
|
private readonly _traces;
|
|
33
36
|
readonly ignoredTrackIds: Set<string>;
|
|
34
37
|
constructor(config: StuckedInboundTrackDetectorConfig);
|
|
35
38
|
update(inboundRtps: IterableIterator<InboundRtpEntry>): void;
|
|
39
|
+
get closed(): boolean;
|
|
36
40
|
close(): void;
|
|
37
41
|
}
|
|
38
42
|
//# sourceMappingURL=StuckedInboundTrack.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StuckedInboundTrack.d.ts","sourceRoot":"","sources":["../../src/detectors/StuckedInboundTrack.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"StuckedInboundTrack.d.ts","sourceRoot":"","sources":["../../src/detectors/StuckedInboundTrack.ts"],"names":[],"mappings":";AAAA,OAAO,E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,CAAC,EAAE,GAAG,MAAM,EAAE,sBAAsB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC;CACtG;AAED,qBAAa,2BAA4B,SAAQ,YAAY;aAU3C,MAAM,EAAE,iCAAiC;IAT1D,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,cAAc,CAAqB;IAC3C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA2C;IACnE,SAAgB,eAAe,cAG5B;gBAGc,MAAM,EAAE,iCAAiC;IAMnD,MAAM,CAAC,WAAW,EAAE,gBAAgB,CAAC,eAAe,CAAC;IA+D5D,IAAW,MAAM,YAEhB;IAEM,KAAK;CAOZ"}
|
|
@@ -7,6 +7,7 @@ class StuckedInboundTrackDetector extends events_1.EventEmitter {
|
|
|
7
7
|
super();
|
|
8
8
|
this.config = config;
|
|
9
9
|
this._closed = false;
|
|
10
|
+
this._stuckedTracks = new Set();
|
|
10
11
|
this._traces = new Map();
|
|
11
12
|
this.ignoredTrackIds = new Set([
|
|
12
13
|
// mediasoup probator track id
|
|
@@ -28,6 +29,11 @@ class StuckedInboundTrackDetector extends events_1.EventEmitter {
|
|
|
28
29
|
keepingTraceIds.add(traceId);
|
|
29
30
|
if (inboundRtp.stats.bytesReceived !== 0) {
|
|
30
31
|
this._traces.delete(traceId);
|
|
32
|
+
const countBefore = this._stuckedTracks.size;
|
|
33
|
+
this._stuckedTracks.delete(traceId);
|
|
34
|
+
if (countBefore === 1 && this._stuckedTracks.size === 0) {
|
|
35
|
+
this.emit('alert-state', 'off');
|
|
36
|
+
}
|
|
31
37
|
continue;
|
|
32
38
|
}
|
|
33
39
|
const trace = this._traces.get(traceId);
|
|
@@ -47,6 +53,10 @@ class StuckedInboundTrackDetector extends events_1.EventEmitter {
|
|
|
47
53
|
trackId,
|
|
48
54
|
ssrc,
|
|
49
55
|
});
|
|
56
|
+
this._stuckedTracks.add(traceId);
|
|
57
|
+
if (this._stuckedTracks.size === 1) {
|
|
58
|
+
this.emit('alert-state', 'on');
|
|
59
|
+
}
|
|
50
60
|
trace.reported = true;
|
|
51
61
|
}
|
|
52
62
|
}
|
|
@@ -57,6 +67,9 @@ class StuckedInboundTrackDetector extends events_1.EventEmitter {
|
|
|
57
67
|
}
|
|
58
68
|
}
|
|
59
69
|
}
|
|
70
|
+
get closed() {
|
|
71
|
+
return this._closed;
|
|
72
|
+
}
|
|
60
73
|
close() {
|
|
61
74
|
if (this._closed)
|
|
62
75
|
return;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import EventEmitter from "events";
|
|
3
3
|
import { InboundRtpEntry } from "../entries/StatsEntryInterfaces";
|
|
4
|
+
import { AlertState } from "../ClientMonitor";
|
|
5
|
+
import { Detector } from "./Detector";
|
|
4
6
|
export type VideoFreezesDetectorConfig = {};
|
|
5
7
|
export type FreezedVideoStartedEvent = {
|
|
6
8
|
peerConnectionId: string | undefined;
|
|
@@ -14,11 +16,12 @@ export type FreezedVideoEndedEvent = {
|
|
|
14
16
|
durationInS: number;
|
|
15
17
|
};
|
|
16
18
|
export type VideoFreezesDetectorEvents = {
|
|
19
|
+
'alert-state': [AlertState];
|
|
17
20
|
freezedVideoStarted: [FreezedVideoStartedEvent];
|
|
18
21
|
freezedVideoEnded: [FreezedVideoEndedEvent];
|
|
19
22
|
close: [];
|
|
20
23
|
};
|
|
21
|
-
export declare interface VideoFreezesDetector {
|
|
24
|
+
export declare interface VideoFreezesDetector extends Detector {
|
|
22
25
|
on<K extends keyof VideoFreezesDetectorEvents>(event: K, listener: (...events: VideoFreezesDetectorEvents[K]) => void): this;
|
|
23
26
|
off<K extends keyof VideoFreezesDetectorEvents>(event: K, listener: (...events: VideoFreezesDetectorEvents[K]) => void): this;
|
|
24
27
|
once<K extends keyof VideoFreezesDetectorEvents>(event: K, listener: (...events: VideoFreezesDetectorEvents[K]) => void): this;
|
|
@@ -28,7 +31,9 @@ export declare class VideoFreezesDetector extends EventEmitter {
|
|
|
28
31
|
readonly config: VideoFreezesDetectorConfig;
|
|
29
32
|
private _closed;
|
|
30
33
|
private readonly _traces;
|
|
34
|
+
private _freezedTracks;
|
|
31
35
|
constructor(config: VideoFreezesDetectorConfig);
|
|
36
|
+
get closed(): boolean;
|
|
32
37
|
close(): void;
|
|
33
38
|
update(inboundRtps: IterableIterator<InboundRtpEntry>): void;
|
|
34
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VideoFreezesDetector.d.ts","sourceRoot":"","sources":["../../src/detectors/VideoFreezesDetector.ts"],"names":[],"mappings":";AAAA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"VideoFreezesDetector.d.ts","sourceRoot":"","sources":["../../src/detectors/VideoFreezesDetector.ts"],"names":[],"mappings":";AAAA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,MAAM,0BAA0B,GAAG,EAExC,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACtC,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACb,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACpC,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACpB,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,CAAC;IAC5B,mBAAmB,EAAE,CAAC,wBAAwB,CAAC,CAAC;IAChD,iBAAiB,EAAE,CAAC,sBAAsB,CAAC,CAAC;IAC5C,KAAK,EAAE,EAAE,CAAC;CACV,CAAA;AAUD,MAAM,CAAC,OAAO,WAAW,oBAAqB,SAAQ,QAAQ;IAC7D,EAAE,CAAC,CAAC,SAAS,MAAM,0BAA0B,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,MAAM,EAAE,0BAA0B,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,IAAI,CAAC;IAC7H,GAAG,CAAC,CAAC,SAAS,MAAM,0BAA0B,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,MAAM,EAAE,0BAA0B,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,IAAI,CAAC;IAC9H,IAAI,CAAC,CAAC,SAAS,MAAM,0BAA0B,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,MAAM,EAAE,0BAA0B,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,IAAI,CAAC;IAC/H,IAAI,CAAC,CAAC,SAAS,MAAM,0BAA0B,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,MAAM,EAAE,0BAA0B,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC;CAC9G;AAED,qBAAa,oBAAqB,SAAQ,YAAY;aAMpC,MAAM,EAAE,0BAA0B;IALnD,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA2C;IACnE,OAAO,CAAC,cAAc,CAAqB;gBAG1B,MAAM,EAAE,0BAA0B;IAOnD,IAAW,MAAM,YAEhB;IAEM,KAAK;IAQL,MAAM,CAAC,WAAW,EAAE,gBAAgB,CAAC,eAAe,CAAC;CAqE5D"}
|
|
@@ -11,8 +11,12 @@ class VideoFreezesDetector extends events_1.default {
|
|
|
11
11
|
this.config = config;
|
|
12
12
|
this._closed = false;
|
|
13
13
|
this._traces = new Map();
|
|
14
|
+
this._freezedTracks = new Set();
|
|
14
15
|
this.setMaxListeners(Infinity);
|
|
15
16
|
}
|
|
17
|
+
get closed() {
|
|
18
|
+
return this._closed;
|
|
19
|
+
}
|
|
16
20
|
close() {
|
|
17
21
|
if (this._closed)
|
|
18
22
|
return;
|
|
@@ -50,6 +54,10 @@ class VideoFreezesDetector extends events_1.default {
|
|
|
50
54
|
trackId,
|
|
51
55
|
ssrc,
|
|
52
56
|
});
|
|
57
|
+
this._freezedTracks.add(trackId);
|
|
58
|
+
if (this._freezedTracks.size === 1) {
|
|
59
|
+
this.emit('alert-state', 'on');
|
|
60
|
+
}
|
|
53
61
|
}
|
|
54
62
|
else if (wasFreezed && !trace.freezed) {
|
|
55
63
|
const durationInS = Math.max(0, (stats.totalFreezesDuration ?? 0) - (trace.freezedStartedDuration ?? 0));
|
|
@@ -60,6 +68,11 @@ class VideoFreezesDetector extends events_1.default {
|
|
|
60
68
|
durationInS,
|
|
61
69
|
ssrc,
|
|
62
70
|
});
|
|
71
|
+
const countBefore = this._freezedTracks.size;
|
|
72
|
+
this._freezedTracks.delete(trackId);
|
|
73
|
+
if (countBefore === 1 && this._freezedTracks.size === 0) {
|
|
74
|
+
this.emit('alert-state', 'off');
|
|
75
|
+
}
|
|
63
76
|
}
|
|
64
77
|
}
|
|
65
78
|
for (const trace of this._traces.values()) {
|
|
@@ -9,6 +9,8 @@ export declare function createInboundTrackStats(peerConnection: PeerConnectionEn
|
|
|
9
9
|
sfuStreamId: string | undefined;
|
|
10
10
|
sfuSinkId: string | undefined;
|
|
11
11
|
remoteClientId: string | undefined;
|
|
12
|
+
bitrate: number;
|
|
13
|
+
roundTripTimeInS: number;
|
|
12
14
|
receivingBitrate: number;
|
|
13
15
|
lostPackets: number;
|
|
14
16
|
receivedPackets: number;
|
|
@@ -18,6 +20,7 @@ export declare function createInboundTrackStats(peerConnection: PeerConnectionEn
|
|
|
18
20
|
receivedSamples: number;
|
|
19
21
|
silentConcealedSamples: number;
|
|
20
22
|
fractionLoss: number;
|
|
23
|
+
jitter: number;
|
|
21
24
|
getPeerConnection: () => PeerConnectionEntry;
|
|
22
25
|
inboundRtps(): IterableIterator<InboundRtpEntry>;
|
|
23
26
|
update: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InboundTrackStats.d.ts","sourceRoot":"","sources":["../../src/entries/InboundTrackStats.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE9E,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,uBAAuB,CAAC,GAAG;IAC5E,SAAS,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,cAAc,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO
|
|
1
|
+
{"version":3,"file":"InboundTrackStats.d.ts","sourceRoot":"","sources":["../../src/entries/InboundTrackStats.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE9E,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,uBAAuB,CAAC,GAAG;IAC5E,SAAS,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,cAAc,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO;;;;;;;;;;;;;;;;;;;;mBA+DnG,iBAAiB,eAAe,CAAC;;EA4ClD"}
|
|
@@ -44,6 +44,9 @@ function createInboundTrackStats(peerConnection, trackId, kind) {
|
|
|
44
44
|
inboundRtp.remoteClientId = value;
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
|
+
bitrate: inboundRtps.reduce((acc, inboundRtp) => acc + (inboundRtp.receivingBitrate ?? 0), 0),
|
|
48
|
+
roundTripTimeInS: -1,
|
|
49
|
+
// deprecated metric receiving bitrate
|
|
47
50
|
receivingBitrate: inboundRtps.reduce((acc, inboundRtp) => acc + (inboundRtp.receivingBitrate ?? 0), 0),
|
|
48
51
|
lostPackets: inboundRtps.reduce((acc, inboundRtp) => acc + (inboundRtp.lostPackets ?? 0), 0),
|
|
49
52
|
receivedPackets: inboundRtps.reduce((acc, inboundRtp) => acc + (inboundRtp.receivedPackets ?? 0), 0),
|
|
@@ -53,12 +56,13 @@ function createInboundTrackStats(peerConnection, trackId, kind) {
|
|
|
53
56
|
receivedSamples: inboundRtps.reduce((acc, inboundRtp) => acc + (inboundRtp.receivedSamples ?? 0), 0),
|
|
54
57
|
silentConcealedSamples: inboundRtps.reduce((acc, inboundRtp) => acc + (inboundRtp.silentConcealedSamples ?? 0), 0),
|
|
55
58
|
fractionLoss: inboundRtps.reduce((acc, inboundRtp) => acc + (inboundRtp.fractionLoss ?? 0), 0),
|
|
59
|
+
jitter: inboundRtps.reduce((acc, inboundRtp) => acc + (inboundRtp.stats.jitter ?? 0), 0),
|
|
56
60
|
getPeerConnection: () => peerConnection,
|
|
57
61
|
inboundRtps() {
|
|
58
62
|
return iterator();
|
|
59
63
|
},
|
|
60
64
|
update: () => {
|
|
61
|
-
result.
|
|
65
|
+
result.bitrate = 0;
|
|
62
66
|
result.lostPackets = 0;
|
|
63
67
|
result.receivedPackets = 0;
|
|
64
68
|
result.receivedFrames = 0;
|
|
@@ -67,10 +71,14 @@ function createInboundTrackStats(peerConnection, trackId, kind) {
|
|
|
67
71
|
result.receivedSamples = 0;
|
|
68
72
|
result.silentConcealedSamples = 0;
|
|
69
73
|
result.fractionLoss = 0;
|
|
74
|
+
result.roundTripTimeInS = 0;
|
|
75
|
+
result.jitter = 0;
|
|
76
|
+
let sumRoundTripTimeInS = 0;
|
|
77
|
+
let roundTripTimeCount = 0;
|
|
70
78
|
for (const inboundRtp of iterator()) {
|
|
71
79
|
inboundRtp.sfuStreamId = result.sfuStreamId;
|
|
72
80
|
inboundRtp.sfuSinkId = result.sfuSinkId;
|
|
73
|
-
result.
|
|
81
|
+
result.bitrate += inboundRtp.receivingBitrate ?? 0;
|
|
74
82
|
result.lostPackets += inboundRtp.lostPackets ?? 0;
|
|
75
83
|
result.receivedPackets += inboundRtp.receivedPackets ?? 0;
|
|
76
84
|
result.receivedFrames += inboundRtp.receivedFrames ?? 0;
|
|
@@ -79,7 +87,15 @@ function createInboundTrackStats(peerConnection, trackId, kind) {
|
|
|
79
87
|
result.receivedSamples += inboundRtp.receivedSamples ?? 0;
|
|
80
88
|
result.silentConcealedSamples += inboundRtp.silentConcealedSamples ?? 0;
|
|
81
89
|
result.fractionLoss += inboundRtp.fractionLoss ?? 0;
|
|
90
|
+
result.jitter += inboundRtp.stats.jitter ?? 0;
|
|
91
|
+
const rttInS = inboundRtp.getRemoteOutboundRtp()?.stats.roundTripTime;
|
|
92
|
+
if (rttInS) {
|
|
93
|
+
sumRoundTripTimeInS += rttInS;
|
|
94
|
+
++roundTripTimeCount;
|
|
95
|
+
}
|
|
82
96
|
}
|
|
97
|
+
result.receivingBitrate = result.bitrate;
|
|
98
|
+
result.roundTripTimeInS = roundTripTimeCount > 0 ? sumRoundTripTimeInS / roundTripTimeCount : 0;
|
|
83
99
|
}
|
|
84
100
|
};
|
|
85
101
|
return result;
|
|
@@ -12,10 +12,14 @@ export declare function createOutboundTrackStats(peerConnection: PeerConnectionE
|
|
|
12
12
|
rid: string;
|
|
13
13
|
sendingBitrate: number;
|
|
14
14
|
}[];
|
|
15
|
+
bitrate: number;
|
|
15
16
|
sendingBitrate: number;
|
|
16
17
|
sentPackets: number;
|
|
17
18
|
remoteLostPackets: number;
|
|
18
19
|
remoteReceivedPackets: number;
|
|
20
|
+
fractionLoss: number;
|
|
21
|
+
roundTripTimeInS: number;
|
|
22
|
+
jitter: number;
|
|
19
23
|
getPeerConnection: () => PeerConnectionEntry;
|
|
20
24
|
outboundRtps(): IterableIterator<OutboundRtpEntry>;
|
|
21
25
|
update: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OutboundTrackStats.d.ts","sourceRoot":"","sources":["../../src/entries/OutboundTrackStats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE/E,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,GAAG;IAC9E,SAAS,EAAE,UAAU,CAAC;CACtB,CAAC;AAEF,wBAAgB,wBAAwB,CAAC,cAAc,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO
|
|
1
|
+
{"version":3,"file":"OutboundTrackStats.d.ts","sourceRoot":"","sources":["../../src/entries/OutboundTrackStats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE/E,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,GAAG;IAC9E,SAAS,EAAE,UAAU,CAAC;CACtB,CAAC;AAEF,wBAAgB,wBAAwB,CAAC,cAAc,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO;;;;;;;;;;;;;;;;;;;oBAsCnG,iBAAiB,gBAAgB,CAAC;;EA6CpD"}
|
|
@@ -24,33 +24,51 @@ function createOutboundTrackStats(peerConnection, trackId, kind) {
|
|
|
24
24
|
sfuStreamId = value;
|
|
25
25
|
},
|
|
26
26
|
layers,
|
|
27
|
+
bitrate: layers.reduce((acc, layer) => acc + (layer.sendingBitrate ?? 0), 0),
|
|
28
|
+
// deprecated metric sending bitrate
|
|
27
29
|
sendingBitrate: layers.reduce((acc, layer) => acc + (layer.sendingBitrate ?? 0), 0),
|
|
28
30
|
sentPackets: outboundRtps.reduce((acc, outboundRtp) => acc + (outboundRtp.sentPackets ?? 0), 0),
|
|
29
31
|
remoteLostPackets: outboundRtps.reduce((acc, outboundRtp) => acc + (outboundRtp.getRemoteInboundRtp()?.lostPackets ?? 0), 0),
|
|
30
32
|
remoteReceivedPackets: outboundRtps.reduce((acc, outboundRtp) => acc + (outboundRtp.getRemoteInboundRtp()?.receivedPackets ?? 0), 0),
|
|
33
|
+
fractionLoss: outboundRtps.reduce((acc, outboundRtp) => acc + (outboundRtp.getRemoteInboundRtp()?.stats.fractionLost ?? 0), 0),
|
|
34
|
+
roundTripTimeInS: -1,
|
|
35
|
+
jitter: outboundRtps.reduce((acc, outboundRtp) => acc + (outboundRtp.getRemoteInboundRtp()?.stats.jitter ?? 0), 0),
|
|
31
36
|
getPeerConnection: () => peerConnection,
|
|
32
37
|
outboundRtps() {
|
|
33
38
|
return iterator();
|
|
34
39
|
},
|
|
35
40
|
update: () => {
|
|
41
|
+
result.bitrate = 0;
|
|
36
42
|
result.sendingBitrate = 0;
|
|
37
43
|
result.sentPackets = 0;
|
|
38
44
|
result.remoteLostPackets = 0;
|
|
39
45
|
result.remoteReceivedPackets = 0;
|
|
46
|
+
result.roundTripTimeInS = -1;
|
|
47
|
+
result.jitter = 0;
|
|
40
48
|
result.layers = [];
|
|
49
|
+
let sumRoundTripTimeInS = 0;
|
|
50
|
+
let roundTripTimeCount = 0;
|
|
41
51
|
for (const outboundRtp of iterator()) {
|
|
42
52
|
const ssrc = outboundRtp.getSsrc();
|
|
43
53
|
const rid = outboundRtp.stats.rid;
|
|
44
54
|
const sendingBitrate = outboundRtp.sendingBitrate;
|
|
45
55
|
outboundRtp.sfuStreamId = sfuStreamId;
|
|
46
|
-
result.
|
|
56
|
+
result.bitrate += sendingBitrate ?? 0;
|
|
47
57
|
result.sentPackets += outboundRtp.sentPackets ?? 0;
|
|
48
58
|
result.remoteLostPackets += outboundRtp.getRemoteInboundRtp()?.lostPackets ?? 0;
|
|
49
59
|
result.remoteReceivedPackets += outboundRtp.getRemoteInboundRtp()?.receivedPackets ?? 0;
|
|
60
|
+
result.jitter += outboundRtp.getRemoteInboundRtp()?.stats.jitter ?? 0;
|
|
50
61
|
if (ssrc !== undefined && rid !== undefined && sendingBitrate !== undefined) {
|
|
51
62
|
result.layers.push({ ssrc, rid, sendingBitrate });
|
|
52
63
|
}
|
|
64
|
+
const roundTripTime = outboundRtp.getRemoteInboundRtp()?.stats.roundTripTime;
|
|
65
|
+
if (roundTripTime !== undefined) {
|
|
66
|
+
sumRoundTripTimeInS += roundTripTime;
|
|
67
|
+
roundTripTimeCount++;
|
|
68
|
+
}
|
|
53
69
|
}
|
|
70
|
+
result.sendingBitrate = result.bitrate;
|
|
71
|
+
result.roundTripTimeInS = roundTripTimeCount > 0 ? sumRoundTripTimeInS / roundTripTimeCount : -1;
|
|
54
72
|
}
|
|
55
73
|
};
|
|
56
74
|
return result;
|
|
@@ -241,7 +241,6 @@ class PeerConnectionEntryManifest {
|
|
|
241
241
|
this._emitter.emit('inbound-rtp-added', entry);
|
|
242
242
|
}
|
|
243
243
|
const elapsedTimeInSec = (stats.timestamp - entry.stats.timestamp) / 1000.0;
|
|
244
|
-
entry.decodedFrames = (stats.framesDecoded ?? 0) - (entry.stats.framesDecoded ?? 0);
|
|
245
244
|
entry.avgJitterBufferDelayInMs = (((stats.jitterBufferDelay ?? 0) - (entry.stats.jitterBufferDelay ?? 0)) / ((Math.max(stats.jitterBufferEmittedCount ?? 1, 1)) - (entry.stats.jitterBufferEmittedCount ?? 0))) * 1000.0;
|
|
246
245
|
entry.receivedPackets = (stats.packetsReceived ?? 0) - (entry.stats.packetsReceived ?? 0);
|
|
247
246
|
entry.receivingBitrate = (((stats.bytesReceived ?? 0) - (entry.stats.bytesReceived ?? 0)) * 8) / elapsedTimeInSec;
|
|
@@ -253,6 +252,7 @@ class PeerConnectionEntryManifest {
|
|
|
253
252
|
entry.receivedSamples = (stats.totalSamplesReceived ?? 0) - (entry.stats.totalSamplesReceived ?? 0);
|
|
254
253
|
entry.silentConcealedSamples = (stats.silentConcealedSamples ?? 0) - (entry.stats.silentConcealedSamples ?? 0);
|
|
255
254
|
entry.fractionLoss = entry.lostPackets === 0 && entry.receivedPackets === 0 ? 0 : entry.lostPackets / (entry.lostPackets + entry.receivedPackets);
|
|
255
|
+
entry.framesPerSecond = stats.framesPerSecond ?? (entry.receivedFrames ? (entry.receivedFrames / Math.max(1, elapsedTimeInSec)) : 0);
|
|
256
256
|
entry.stats = stats;
|
|
257
257
|
entry.visited = true;
|
|
258
258
|
if (entry.stats.kind === 'audio') {
|
|
@@ -7,7 +7,12 @@ export interface StatsEntryAbs {
|
|
|
7
7
|
visited: boolean;
|
|
8
8
|
getPeerConnection(): PeerConnectionEntry;
|
|
9
9
|
}
|
|
10
|
-
export type TrackStats = InboundTrackStats | OutboundTrackStats
|
|
10
|
+
export type TrackStats = (InboundTrackStats | OutboundTrackStats) & {
|
|
11
|
+
bitrate: number;
|
|
12
|
+
fractionLoss: number;
|
|
13
|
+
roundTripTimeInS: number;
|
|
14
|
+
jitter: number;
|
|
15
|
+
};
|
|
11
16
|
/**
|
|
12
17
|
* Wraps the [CodecStats](https://www.w3.org/TR/webrtc-stats/#dom-rtccodecstats) and provide methods
|
|
13
18
|
* to navigate to its relations
|
|
@@ -61,6 +66,7 @@ export interface InboundRtpEntry extends ReceivedRtpStreamEntry, StatsEntryAbs {
|
|
|
61
66
|
silentConcealedSamples?: number;
|
|
62
67
|
fractionLoss?: number;
|
|
63
68
|
avgRttInS?: number;
|
|
69
|
+
framesPerSecond?: number;
|
|
64
70
|
/**
|
|
65
71
|
* Navigate to the related ReceiverEntry
|
|
66
72
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatsEntryInterfaces.d.ts","sourceRoot":"","sources":["../../src/entries/StatsEntryInterfaces.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,+BAA+B,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAA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BAAgB,CAAC,qBAAqB,CAAC,CAAC;IAC7D,kBAAkB,IAAI,gBAAgB,CAAC,sBAAsB,CAAC,CAAC;IAC/D,YAAY,IAAI,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IACnD,YAAY,IAAI,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IACnD,UAAU,IAAI,gBAAgB,CAAC,cAAc,CAAC,CAAC;IAC/C,iBAAiB,IAAI,gBAAgB,CAAC,qBAAqB,CAAC,CAAC;IAC7D,eAAe,IAAI,gBAAgB,CAAC,mBAAmB,CAAC,CAAC;IACzD,gBAAgB,IAAI,gBAAgB,CAAC,oBAAoB,CAAC,CAAC;IAC3D,aAAa,IAAI,gBAAgB,CAAC,iBAAiB,CAAC,CAAC;IACrD,YAAY,IAAI,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IACnD,OAAO,IAAI,gBAAgB,CAAC,WAAW,CAAC,CAAC;IACzC,SAAS,IAAI,gBAAgB,CAAC,aAAa,CAAC,CAAC;IAC7C,cAAc,IAAI,gBAAgB,CAAC,kBAAkB,CAAC,CAAC;IACvD,YAAY,IAAI,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IACnD,UAAU,IAAI,gBAAgB,CAAC,cAAc,CAAC,CAAC;IAC/C,mBAAmB,IAAI,gBAAgB,CAAC,uBAAuB,CAAC,CAAC;CACpE"}
|
package/lib/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export type { MediasoupStatsCollector } from "./collectors/MediasoupStatsCollect
|
|
|
4
4
|
export type { PeerConnectionStatsCollector } from "./collectors/PeerConnectionStatsCollector";
|
|
5
5
|
export type { ClientIssue, ClientMonitor, ClientMonitorConfig, ClientMonitorEvents, } from "./ClientMonitor";
|
|
6
6
|
export type { VideoFreezesDetector, VideoFreezesDetectorConfig, FreezedVideoStartedEvent, FreezedVideoEndedEvent, } from './detectors/VideoFreezesDetector';
|
|
7
|
-
export type { CongestionDetector } from './detectors/CongestionDetector';
|
|
7
|
+
export type { CongestionDetector, CongestionDetectorConfig } from './detectors/CongestionDetector';
|
|
8
8
|
export type { CpuPerformanceDetector, CpuPerformanceDetectorConfig } from './detectors/CpuPerformanceDetector';
|
|
9
9
|
export type { AudioDesyncDetector, AudioDesyncDetectorConfig } from './detectors/AudioDesyncDetector';
|
|
10
10
|
export type { Collectors } from './Collectors';
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAClE,YAAY,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,YAAY,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AACpF,YAAY,EAAE,4BAA4B,EAAE,MAAM,2CAA2C,CAAC;AAC9F,YAAY,EACR,WAAW,EACX,aAAa,EACb,mBAAmB,EACnB,mBAAmB,GACtB,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EACR,oBAAoB,EACpB,0BAA0B,EAC1B,wBAAwB,EACxB,sBAAsB,GACzB,MAAM,kCAAkC,CAAC;AAC1C,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAClE,YAAY,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,YAAY,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AACpF,YAAY,EAAE,4BAA4B,EAAE,MAAM,2CAA2C,CAAC;AAC9F,YAAY,EACR,WAAW,EACX,aAAa,EACb,mBAAmB,EACnB,mBAAmB,GACtB,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EACR,oBAAoB,EACpB,0BAA0B,EAC1B,wBAAwB,EACxB,sBAAsB,GACzB,MAAM,kCAAkC,CAAC;AAC1C,YAAY,EACR,kBAAkB,E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