@observertc/observer-js 1.0.1-57a1811.0 → 1.0.1-c3edea3.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/ObservedCall.d.ts +0 -13
- package/lib/ObservedCall.d.ts.map +1 -1
- package/lib/ObservedCall.js +1 -37
- package/lib/ObservedClient.d.ts +7 -39
- package/lib/ObservedClient.d.ts.map +1 -1
- package/lib/ObservedClient.js +58 -110
- package/lib/ObservedDataChannel.d.ts +0 -4
- package/lib/ObservedDataChannel.d.ts.map +1 -1
- package/lib/ObservedDataChannel.js +0 -28
- package/lib/ObservedIceCandidatePair.d.ts +0 -4
- package/lib/ObservedIceCandidatePair.d.ts.map +1 -1
- package/lib/ObservedIceCandidatePair.js +0 -28
- package/lib/ObservedPeerConnection.d.ts +0 -10
- package/lib/ObservedPeerConnection.d.ts.map +1 -1
- package/lib/ObservedPeerConnection.js +9 -79
- package/lib/Observer.d.ts +21 -27
- package/lib/Observer.d.ts.map +1 -1
- package/lib/Observer.js +40 -59
- package/lib/index.d.ts +0 -4
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -5
- package/lib/schema/{ClientEventTypes.d.ts → eventTypes.d.ts} +2 -2
- package/lib/schema/eventTypes.d.ts.map +1 -0
- package/lib/schema/eventTypes.js +38 -0
- package/lib/schema/{ClientMetaTypes.d.ts → metaTypes.d.ts} +2 -2
- package/lib/schema/metaTypes.d.ts.map +1 -0
- package/lib/schema/metaTypes.js +16 -0
- package/package.json +1 -1
- package/src/ObservedCall.ts +1 -44
- package/src/ObservedClient.ts +60 -125
- package/src/ObservedDataChannel.ts +0 -29
- package/src/ObservedIceCandidatePair.ts +0 -26
- package/src/ObservedPeerConnection.ts +10 -90
- package/src/Observer.ts +68 -81
- package/src/index.ts +0 -4
- package/src/schema/{ClientEventTypes.ts → eventTypes.ts} +1 -1
- package/src/schema/{ClientMetaTypes.ts → metaTypes.ts} +1 -1
- package/lib/ObservedTURN.d.ts +0 -31
- package/lib/ObservedTURN.d.ts.map +0 -1
- package/lib/ObservedTURN.js +0 -58
- package/lib/ObservedTurnServer.d.ts +0 -25
- package/lib/ObservedTurnServer.d.ts.map +0 -1
- package/lib/ObservedTurnServer.js +0 -59
- package/lib/schema/ClientEventTypes.d.ts.map +0 -1
- package/lib/schema/ClientEventTypes.js +0 -38
- package/lib/schema/ClientMetaTypes.d.ts.map +0 -1
- package/lib/schema/ClientMetaTypes.js +0 -16
- package/src/ObservedTURN.ts +0 -86
- package/src/ObservedTurnServer.ts +0 -72
package/lib/ObservedCall.d.ts
CHANGED
|
@@ -34,29 +34,16 @@ export declare class ObservedCall<AppData extends Record<string, unknown> = Reco
|
|
|
34
34
|
readonly calculatedScore: CalculatedScore;
|
|
35
35
|
remoteTrackResolver?: RemoteTrackResolver;
|
|
36
36
|
callUpdater?: CallUpdater;
|
|
37
|
-
totalAudioBytesSent: number;
|
|
38
|
-
totalAudioBytesReceived: number;
|
|
39
|
-
totalVideoBytesSent: number;
|
|
40
|
-
totalVideoBytesReceived: number;
|
|
41
|
-
totalDataChannelBytesSent: number;
|
|
42
|
-
totalDataChannelBytesReceived: number;
|
|
43
|
-
numberOfPeerConnections: number;
|
|
44
|
-
numberOfInboundRtpStreams: number;
|
|
45
|
-
numberOfOutboundRtpStreams: number;
|
|
46
|
-
numberOfDataChannels: number;
|
|
47
|
-
maxNumberOfClients: number;
|
|
48
37
|
appData?: AppData;
|
|
49
38
|
closed: boolean;
|
|
50
39
|
started?: number;
|
|
51
40
|
ended?: number;
|
|
52
41
|
scoreCalculator: ScoreCalculator;
|
|
53
42
|
constructor(settings: ObservedCallSettings<AppData>, observer: Observer);
|
|
54
|
-
get numberOfClients(): number;
|
|
55
43
|
get score(): number | undefined;
|
|
56
44
|
close(): void;
|
|
57
45
|
getObservedClient<ClientAppData extends Record<string, unknown> = Record<string, unknown>>(clientId: string): ObservedClient<ClientAppData> | undefined;
|
|
58
46
|
createObservedClient<ClientAppData extends Record<string, unknown> = Record<string, unknown>>(settings: ObservedClientSettings<ClientAppData>): ObservedClient<ClientAppData>;
|
|
59
47
|
update(): void;
|
|
60
|
-
private _onClientUpdate;
|
|
61
48
|
}
|
|
62
49
|
//# sourceMappingURL=ObservedCall.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObservedCall.d.ts","sourceRoot":"","sources":["../src/ObservedCall.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAIlD,MAAM,MAAM,oBAAoB,CAAC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI;IACrG,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,wBAAwB,CAAC,EAAE,KAAK,GAAG,eAAe,CAAC;IACnD,iBAAiB,CAAC,EAAE,mBAAmB,GAAG,oBAAoB,CAAC;CAC/D,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAChC,MAAM,EAAE,EAAE,CAAC;IACX,SAAS,EAAE,CAAC,cAAc,CAAC,CAAC;IAC5B,KAAK,EAAE,EAAE,CAAC;IACV,WAAW,EAAE,EAAE,CAAC;IAChB,KAAK,EAAE,EAAE,CAAC;CACV,CAAA;AAED,MAAM,CAAC,OA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
|
21
|
-
totalAudioBytesSent = 0;
|
|
22
|
-
totalAudioBytesReceived = 0;
|
|
23
|
-
totalVideoBytesSent = 0;
|
|
24
|
-
totalVideoBytesReceived = 0;
|
|
25
|
-
totalDataChannelBytesSent = 0;
|
|
26
|
-
totalDataChannelBytesReceived = 0;
|
|
27
|
-
numberOfPeerConnections = 0;
|
|
28
|
-
numberOfInboundRtpStreams = 0;
|
|
29
|
-
numberOfOutboundRtpStreams = 0;
|
|
30
|
-
numberOfDataChannels = 0;
|
|
31
|
-
maxNumberOfClients = 0;
|
|
32
21
|
appData;
|
|
33
22
|
closed = false;
|
|
34
23
|
started;
|
|
@@ -55,9 +44,6 @@ class ObservedCall extends events_1.EventEmitter {
|
|
|
55
44
|
break;
|
|
56
45
|
}
|
|
57
46
|
}
|
|
58
|
-
get numberOfClients() {
|
|
59
|
-
return this.observedClients.size;
|
|
60
|
-
}
|
|
61
47
|
get score() {
|
|
62
48
|
return this.calculatedScore.value;
|
|
63
49
|
}
|
|
@@ -80,7 +66,7 @@ class ObservedCall extends events_1.EventEmitter {
|
|
|
80
66
|
throw new Error(`Client with id ${settings.clientId} already exists`);
|
|
81
67
|
const result = new ObservedClient_1.ObservedClient(settings, this);
|
|
82
68
|
const wasEmpty = this.observedClients.size === 0;
|
|
83
|
-
const onUpdate = () => this.
|
|
69
|
+
const onUpdate = () => this.callUpdater?.onClientUpdate(result);
|
|
84
70
|
result.once('close', () => {
|
|
85
71
|
result.off('update', onUpdate);
|
|
86
72
|
this.observedClients.delete(settings.clientId);
|
|
@@ -90,7 +76,6 @@ class ObservedCall extends events_1.EventEmitter {
|
|
|
90
76
|
});
|
|
91
77
|
result.on('update', onUpdate);
|
|
92
78
|
this.observedClients.set(settings.clientId, result);
|
|
93
|
-
this.maxNumberOfClients = Math.max(this.maxNumberOfClients, this.observedClients.size);
|
|
94
79
|
this.emit('newclient', result);
|
|
95
80
|
if (wasEmpty) {
|
|
96
81
|
this.emit('not-empty');
|
|
@@ -98,30 +83,9 @@ class ObservedCall extends events_1.EventEmitter {
|
|
|
98
83
|
return result;
|
|
99
84
|
}
|
|
100
85
|
update() {
|
|
101
|
-
if (this.closed)
|
|
102
|
-
return;
|
|
103
|
-
this.numberOfInboundRtpStreams = 0;
|
|
104
|
-
this.numberOfOutboundRtpStreams = 0;
|
|
105
|
-
this.numberOfPeerConnections = 0;
|
|
106
|
-
this.numberOfDataChannels = 0;
|
|
107
|
-
for (const client of this.observedClients.values()) {
|
|
108
|
-
this.numberOfInboundRtpStreams += client.numberOfInboundRtpStreams;
|
|
109
|
-
this.numberOfOutboundRtpStreams += client.numberOfOutboundRtpStreams;
|
|
110
|
-
this.numberOfPeerConnections += client.numberOfPeerConnections;
|
|
111
|
-
this.numberOfDataChannels += client.numberOfDataChannels;
|
|
112
|
-
}
|
|
113
86
|
this.detectors.update();
|
|
114
87
|
this.scoreCalculator.update();
|
|
115
88
|
this.emit('update');
|
|
116
89
|
}
|
|
117
|
-
_onClientUpdate(client) {
|
|
118
|
-
this.callUpdater?.onClientUpdate(client);
|
|
119
|
-
this.totalAudioBytesReceived = client.deltaReceivedAudioBytes;
|
|
120
|
-
this.totalAudioBytesSent = client.deltaSentAudioBytes;
|
|
121
|
-
this.totalVideoBytesReceived = client.deltaReceivedVideoBytes;
|
|
122
|
-
this.totalVideoBytesSent = client.deltaSentVideoBytes;
|
|
123
|
-
this.totalDataChannelBytesReceived = client.deltaDataChannelBytesReceived;
|
|
124
|
-
this.totalDataChannelBytesSent = client.deltaDataChannelBytesSent;
|
|
125
|
-
}
|
|
126
90
|
}
|
|
127
91
|
exports.ObservedCall = ObservedCall;
|
package/lib/ObservedClient.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { EventEmitter } from 'events';
|
|
3
3
|
import { ObservedPeerConnection } from './ObservedPeerConnection';
|
|
4
4
|
import { ClientMetaData, ClientSample, ClientIssue, ExtensionStat } from './schema/ClientSample';
|
|
5
|
-
import * as MetaData from './schema/
|
|
5
|
+
import * as MetaData from './schema/metaTypes';
|
|
6
6
|
import { ObservedCall } from './ObservedCall';
|
|
7
7
|
import { CalculatedScore } from './scores/CalculatedScore';
|
|
8
8
|
import { Detectors } from './detectors/Detectors';
|
|
@@ -19,8 +19,6 @@ export type ObservedClientEvents = {
|
|
|
19
19
|
];
|
|
20
20
|
close: [];
|
|
21
21
|
joined: [];
|
|
22
|
-
issue: [ClientIssue];
|
|
23
|
-
metaData: [ClientMetaData];
|
|
24
22
|
rejoined: [timestamp: number];
|
|
25
23
|
left: [];
|
|
26
24
|
usingturn: [boolean];
|
|
@@ -54,51 +52,21 @@ export declare class ObservedClient<AppData extends Record<string, unknown> = Re
|
|
|
54
52
|
usingTURN: boolean;
|
|
55
53
|
availableOutgoingBitrate: number;
|
|
56
54
|
availableIncomingBitrate: number;
|
|
57
|
-
totalInboundPacketsLost: number;
|
|
58
|
-
totalInboundPacketsReceived: number;
|
|
59
|
-
totalOutboundPacketsSent: number;
|
|
60
|
-
totalDataChannelBytesSent: number;
|
|
61
|
-
totalDataChannelBytesReceived: number;
|
|
62
|
-
totalDataChannelMessagesSent: number;
|
|
63
|
-
totalDataChannelMessagesReceived: number;
|
|
64
|
-
totalSentBytes: number;
|
|
65
|
-
totalReceivedBytes: number;
|
|
66
|
-
totalReceivedAudioBytes: number;
|
|
67
|
-
totalReceivedVideoBytes: number;
|
|
68
|
-
totalSentAudioBytes: number;
|
|
69
|
-
totalSentVideoBytes: number;
|
|
70
|
-
deltaReceivedAudioBytes: number;
|
|
71
|
-
deltaReceivedVideoBytes: number;
|
|
72
|
-
deltaSentAudioBytes: number;
|
|
73
|
-
deltaSentVideoBytes: number;
|
|
74
|
-
deltaDataChannelBytesSent: number;
|
|
75
|
-
deltaDataChannelBytesReceived: number;
|
|
76
|
-
deltaDataChannelMessagesSent: number;
|
|
77
|
-
deltaDataChannelMessagesReceived: number;
|
|
78
|
-
deltaInboundPacketsLost: number;
|
|
79
|
-
deltaInboundPacketsReceived: number;
|
|
80
|
-
deltaOutboundPacketsSent: number;
|
|
81
55
|
avgRttInMs?: number;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
numberOfInboundRtpStreams: number;
|
|
87
|
-
numberOfInbundTracks: number;
|
|
88
|
-
numberOfOutboundRtpStreams: number;
|
|
89
|
-
numberOfOutboundTracks: number;
|
|
90
|
-
numberOfDataChannels: number;
|
|
56
|
+
outboundAudioBitrate?: number;
|
|
57
|
+
outboundVideoBitrate?: number;
|
|
58
|
+
inboundAudioBitrate?: number;
|
|
59
|
+
inboundVideoBitrate?: number;
|
|
91
60
|
readonly mediaDevices: MetaData.MediaDeviceInfo[];
|
|
92
61
|
issues: ClientIssue[];
|
|
93
62
|
constructor(settings: ObservedClientSettings<AppData>, call: ObservedCall);
|
|
94
|
-
get numberOfPeerConnections(): number;
|
|
95
63
|
get score(): number | undefined;
|
|
96
64
|
close(): void;
|
|
97
65
|
accept(sample: ClientSample): void;
|
|
98
66
|
private _processClientEvent;
|
|
99
67
|
processMetadata(metadata: ClientMetaData): void;
|
|
100
|
-
|
|
101
|
-
|
|
68
|
+
processIssue(issue: ClientIssue): void;
|
|
69
|
+
processExtensionStats(stats: ExtensionStat): void;
|
|
102
70
|
private _updatePeerConnection;
|
|
103
71
|
}
|
|
104
72
|
//# sourceMappingURL=ObservedClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObservedClient.d.ts","sourceRoot":"","sources":["../src/ObservedClient.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAGlE,OAAO,EAAe,cAAc,EAAE,YAAY,EAAwB,WAAW,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACpI,OAAO,KAAK,QAAQ,MAAM,
|
|
1
|
+
{"version":3,"file":"ObservedClient.d.ts","sourceRoot":"","sources":["../src/Ob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,CAAC;IAC3B,gBAAgB,EAAE,MAAM,EAAE,CAAM;IAEhC,SAAS,UAAS;IAClB,wBAAwB,SAAK;IAC7B,wBAAwB,SAAK;IAuB7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAEpC,SAAgB,YAAY,EAAE,QAAQ,CAAC,eAAe,EAAE,CAAM;IACvD,MAAM,EAAE,WAAW,EAAE,CAAM;gBAEf,QAAQ,EAAE,sBAAsB,CAAC,OAAO,CAAC,EAAkB,IAAI,EAAE,YAAY;IAShG,IAAW,KAAK,uBAEf;IAEM,KAAK;IASL,MAAM,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI;IAyBzC,OAAO,CAAC,mBAAmB;IA0CpB,eAAe,CAAC,QAAQ,EAAE,cAAc;IA2BxC,YAAY,CAAC,KAAK,EAAE,WAAW;IAQ/B,qBAAqB,CAAC,KAAK,EAAE,aAAa;IAQjD,OAAO,CAAC,qBAAqB;CAqB7B"}
|
package/lib/ObservedClient.js
CHANGED
|
@@ -4,8 +4,8 @@ exports.ObservedClient = void 0;
|
|
|
4
4
|
const events_1 = require("events");
|
|
5
5
|
const ObservedPeerConnection_1 = require("./ObservedPeerConnection");
|
|
6
6
|
const logger_1 = require("./common/logger");
|
|
7
|
-
const
|
|
8
|
-
const
|
|
7
|
+
const eventTypes_1 = require("./schema/eventTypes");
|
|
8
|
+
const metaTypes_1 = require("./schema/metaTypes");
|
|
9
9
|
const utils_1 = require("./common/utils");
|
|
10
10
|
const Detectors_1 = require("./detectors/Detectors");
|
|
11
11
|
const logger = (0, logger_1.createLogger)('ObservedClient');
|
|
@@ -34,40 +34,31 @@ class ObservedClient extends events_1.EventEmitter {
|
|
|
34
34
|
usingTURN = false;
|
|
35
35
|
availableOutgoingBitrate = 0;
|
|
36
36
|
availableIncomingBitrate = 0;
|
|
37
|
-
totalInboundPacketsLost = 0;
|
|
38
|
-
totalInboundPacketsReceived = 0;
|
|
39
|
-
totalOutboundPacketsSent = 0;
|
|
40
|
-
totalDataChannelBytesSent = 0;
|
|
41
|
-
totalDataChannelBytesReceived = 0;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
deltaDataChannelMessagesReceived = 0;
|
|
58
|
-
deltaInboundPacketsLost = 0;
|
|
59
|
-
deltaInboundPacketsReceived = 0;
|
|
60
|
-
deltaOutboundPacketsSent = 0;
|
|
37
|
+
// public totalInboundPacketsLost = 0;
|
|
38
|
+
// public totalInboundPacketsReceived = 0;
|
|
39
|
+
// public totalOutboundPacketsSent = 0;
|
|
40
|
+
// public totalDataChannelBytesSent = 0;
|
|
41
|
+
// public totalDataChannelBytesReceived = 0;
|
|
42
|
+
// public totalSentBytes = 0;
|
|
43
|
+
// public totalReceivedBytes = 0;
|
|
44
|
+
// public totalReceivedAudioBytes = 0;
|
|
45
|
+
// public totalReceivedVideoBytes = 0;
|
|
46
|
+
// public totalSentAudioBytes = 0;
|
|
47
|
+
// public totalSentVideoBytes = 0;
|
|
48
|
+
// public deltaReceivedAudioBytes = 0;
|
|
49
|
+
// public deltaReceivedVideoBytes = 0;
|
|
50
|
+
// public deltaSentAudioBytes = 0;
|
|
51
|
+
// public deltaSentVideoBytes = 0;
|
|
52
|
+
// public deltaDataChannelBytesSent = 0;
|
|
53
|
+
// public deltaDataChannelBytesReceived = 0;
|
|
54
|
+
// public deltaInboundPacketsLost = 0;
|
|
55
|
+
// public deltaInboundPacketsReceived = 0;
|
|
56
|
+
// public deltaOutboundPacketsSent = 0;
|
|
61
57
|
avgRttInMs;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
numberOfInboundRtpStreams = 0;
|
|
67
|
-
numberOfInbundTracks = 0;
|
|
68
|
-
numberOfOutboundRtpStreams = 0;
|
|
69
|
-
numberOfOutboundTracks = 0;
|
|
70
|
-
numberOfDataChannels = 0;
|
|
58
|
+
outboundAudioBitrate;
|
|
59
|
+
outboundVideoBitrate;
|
|
60
|
+
inboundAudioBitrate;
|
|
61
|
+
inboundVideoBitrate;
|
|
71
62
|
mediaDevices = [];
|
|
72
63
|
issues = [];
|
|
73
64
|
constructor(settings, call) {
|
|
@@ -78,9 +69,6 @@ class ObservedClient extends events_1.EventEmitter {
|
|
|
78
69
|
this.appData = settings.appData;
|
|
79
70
|
this.detectors = new Detectors_1.Detectors();
|
|
80
71
|
}
|
|
81
|
-
get numberOfPeerConnections() {
|
|
82
|
-
return this.observedPeerConnections.size;
|
|
83
|
-
}
|
|
84
72
|
get score() {
|
|
85
73
|
return this.calculatedScore.value;
|
|
86
74
|
}
|
|
@@ -95,49 +83,13 @@ class ObservedClient extends events_1.EventEmitter {
|
|
|
95
83
|
if (this.closed)
|
|
96
84
|
throw new Error(`Client ${this.clientId} is closed`);
|
|
97
85
|
const now = Date.now();
|
|
98
|
-
const elapsedInMs = now - this.updated;
|
|
99
|
-
const elapsedInSeconds = elapsedInMs / 1000;
|
|
100
|
-
++this.acceptedSamples;
|
|
101
|
-
this.availableIncomingBitrate = 0;
|
|
102
|
-
this.availableOutgoingBitrate = 0;
|
|
103
|
-
this.deltaDataChannelBytesReceived = 0;
|
|
104
|
-
this.deltaDataChannelBytesSent = 0;
|
|
105
|
-
this.deltaDataChannelMessagesReceived = 0;
|
|
106
|
-
this.deltaDataChannelMessagesSent = 0;
|
|
107
|
-
this.deltaInboundPacketsLost = 0;
|
|
108
|
-
this.deltaInboundPacketsReceived = 0;
|
|
109
|
-
this.deltaOutboundPacketsSent = 0;
|
|
110
|
-
this.deltaReceivedAudioBytes = 0;
|
|
111
|
-
this.deltaReceivedVideoBytes = 0;
|
|
112
|
-
this.deltaSentAudioBytes = 0;
|
|
113
|
-
this.deltaSentVideoBytes = 0;
|
|
114
|
-
this.numberOfDataChannels = 0;
|
|
115
|
-
this.numberOfInboundRtpStreams = 0;
|
|
116
|
-
this.numberOfInbundTracks = 0;
|
|
117
|
-
this.numberOfOutboundRtpStreams = 0;
|
|
118
|
-
this.numberOfOutboundTracks = 0;
|
|
119
86
|
sample.clientEvents?.forEach(this._processClientEvent.bind(this));
|
|
120
87
|
sample.clientMetaItems?.forEach(this.processMetadata.bind(this));
|
|
121
|
-
sample.clientIssues?.forEach(this.
|
|
88
|
+
sample.clientIssues?.forEach(this.processIssue.bind(this));
|
|
122
89
|
sample.peerConnections?.forEach(this._updatePeerConnection.bind(this));
|
|
123
|
-
sample.extensionStats?.forEach(this.
|
|
90
|
+
sample.extensionStats?.forEach(this.processExtensionStats.bind(this));
|
|
124
91
|
// emit new attachments?
|
|
125
92
|
this.attachments = sample.attachments;
|
|
126
|
-
this.totalDataChannelBytesReceived += this.deltaDataChannelBytesReceived;
|
|
127
|
-
this.totalDataChannelBytesSent += this.deltaDataChannelBytesSent;
|
|
128
|
-
this.totalDataChannelMessagesReceived += this.deltaDataChannelMessagesReceived;
|
|
129
|
-
this.totalDataChannelMessagesSent += this.deltaDataChannelMessagesSent;
|
|
130
|
-
this.totalInboundPacketsLost += this.deltaInboundPacketsLost;
|
|
131
|
-
this.totalInboundPacketsReceived += this.deltaInboundPacketsReceived;
|
|
132
|
-
this.totalOutboundPacketsSent += this.deltaOutboundPacketsSent;
|
|
133
|
-
this.totalReceivedAudioBytes += this.deltaReceivedAudioBytes;
|
|
134
|
-
this.totalReceivedVideoBytes += this.deltaReceivedVideoBytes;
|
|
135
|
-
this.totalSentAudioBytes += this.deltaSentAudioBytes;
|
|
136
|
-
this.totalSentVideoBytes += this.deltaSentVideoBytes;
|
|
137
|
-
this.receivingAudioBitrate = (this.deltaReceivedAudioBytes * 8) / (elapsedInSeconds);
|
|
138
|
-
this.receivingVideoBitrate = (this.totalReceivedVideoBytes * 8) / (elapsedInSeconds);
|
|
139
|
-
this.sendingAudioBitrate = (this.deltaSentAudioBytes * 8) / (elapsedInSeconds);
|
|
140
|
-
this.sendingVideoBitrate = (this.deltaSentVideoBytes * 8) / (elapsedInSeconds);
|
|
141
93
|
this.calculatedScore.value = sample.score;
|
|
142
94
|
this.detectors.update();
|
|
143
95
|
// emit update
|
|
@@ -149,15 +101,15 @@ class ObservedClient extends events_1.EventEmitter {
|
|
|
149
101
|
}
|
|
150
102
|
_processClientEvent(event) {
|
|
151
103
|
switch (event.type) {
|
|
152
|
-
case
|
|
104
|
+
case eventTypes_1.ClientEventType.CALL_STARTED: {
|
|
153
105
|
// update call timestamp if it's the first time
|
|
154
106
|
break;
|
|
155
107
|
}
|
|
156
|
-
case
|
|
108
|
+
case eventTypes_1.ClientEventType.CALL_ENDED: {
|
|
157
109
|
// update call timestamp if it's the first time
|
|
158
110
|
break;
|
|
159
111
|
}
|
|
160
|
-
case
|
|
112
|
+
case eventTypes_1.ClientEventType.CLIENT_JOINED: {
|
|
161
113
|
if (event.timestamp) {
|
|
162
114
|
if (!this.joinedAt) {
|
|
163
115
|
this.joinedAt = event.timestamp;
|
|
@@ -173,7 +125,7 @@ class ObservedClient extends events_1.EventEmitter {
|
|
|
173
125
|
}
|
|
174
126
|
break;
|
|
175
127
|
}
|
|
176
|
-
case
|
|
128
|
+
case eventTypes_1.ClientEventType.CLIENT_LEFT: {
|
|
177
129
|
if (event.timestamp) {
|
|
178
130
|
if (!this.leftAt) {
|
|
179
131
|
this.leftAt = event.timestamp;
|
|
@@ -183,35 +135,50 @@ class ObservedClient extends events_1.EventEmitter {
|
|
|
183
135
|
break;
|
|
184
136
|
}
|
|
185
137
|
}
|
|
186
|
-
this.call.observer.
|
|
138
|
+
this.call.observer.processors.events.process({
|
|
139
|
+
call: this.call,
|
|
140
|
+
client: this,
|
|
141
|
+
data: event,
|
|
142
|
+
});
|
|
187
143
|
}
|
|
188
144
|
processMetadata(metadata) {
|
|
189
145
|
switch (metadata.type) {
|
|
190
|
-
case
|
|
146
|
+
case metaTypes_1.ClientMetaType.BROWSER: {
|
|
191
147
|
this.browser = (0, utils_1.parseJsonAs)(metadata.payload);
|
|
192
148
|
break;
|
|
193
149
|
}
|
|
194
|
-
case
|
|
150
|
+
case metaTypes_1.ClientMetaType.ENGINE: {
|
|
195
151
|
this.engine = (0, utils_1.parseJsonAs)(metadata.payload);
|
|
196
152
|
break;
|
|
197
153
|
}
|
|
198
|
-
case
|
|
154
|
+
case metaTypes_1.ClientMetaType.PLATFORM: {
|
|
199
155
|
this.platform = (0, utils_1.parseJsonAs)(metadata.payload);
|
|
200
156
|
break;
|
|
201
157
|
}
|
|
202
|
-
case
|
|
158
|
+
case metaTypes_1.ClientMetaType.OPERATION_SYSTEM: {
|
|
203
159
|
this.operationSystem = (0, utils_1.parseJsonAs)(metadata.payload);
|
|
204
160
|
break;
|
|
205
161
|
}
|
|
206
162
|
}
|
|
207
|
-
this.call.observer.
|
|
163
|
+
this.call.observer.processors.metaData.process({
|
|
164
|
+
call: this.call,
|
|
165
|
+
client: this,
|
|
166
|
+
data: metadata,
|
|
167
|
+
});
|
|
208
168
|
}
|
|
209
|
-
|
|
210
|
-
this.
|
|
211
|
-
|
|
169
|
+
processIssue(issue) {
|
|
170
|
+
this.call.observer.processors.issues.process({
|
|
171
|
+
call: this.call,
|
|
172
|
+
client: this,
|
|
173
|
+
data: issue,
|
|
174
|
+
});
|
|
212
175
|
}
|
|
213
|
-
|
|
214
|
-
this.call.observer.
|
|
176
|
+
processExtensionStats(stats) {
|
|
177
|
+
this.call.observer.processors.extensionStats.process({
|
|
178
|
+
call: this.call,
|
|
179
|
+
client: this,
|
|
180
|
+
data: stats,
|
|
181
|
+
});
|
|
215
182
|
}
|
|
216
183
|
_updatePeerConnection(sample) {
|
|
217
184
|
let observedPeerConnection = this.observedPeerConnections.get(sample.peerConnectionId);
|
|
@@ -224,27 +191,8 @@ class ObservedClient extends events_1.EventEmitter {
|
|
|
224
191
|
this.observedPeerConnections.delete(sample.peerConnectionId);
|
|
225
192
|
});
|
|
226
193
|
this.observedPeerConnections.set(sample.peerConnectionId, observedPeerConnection);
|
|
227
|
-
this.emit('newpeerconnection', observedPeerConnection);
|
|
228
194
|
}
|
|
229
195
|
observedPeerConnection.accept(sample);
|
|
230
|
-
this.deltaDataChannelBytesReceived += observedPeerConnection.deltaDataChannelBytesReceived;
|
|
231
|
-
this.deltaDataChannelBytesSent += observedPeerConnection.deltaDataChannelBytesSent;
|
|
232
|
-
this.deltaDataChannelMessagesReceived += observedPeerConnection.deltaDataChannelMessagesReceived;
|
|
233
|
-
this.deltaDataChannelMessagesSent += observedPeerConnection.deltaDataChannelMessagesSent;
|
|
234
|
-
this.deltaInboundPacketsLost += observedPeerConnection.deltaInboundPacketsLost;
|
|
235
|
-
this.deltaInboundPacketsReceived += observedPeerConnection.deltaInboundPacketsReceived;
|
|
236
|
-
this.deltaOutboundPacketsSent += observedPeerConnection.deltaOutboundPacketsSent;
|
|
237
|
-
this.deltaReceivedAudioBytes += observedPeerConnection.deltaReceivedAudioBytes;
|
|
238
|
-
this.deltaReceivedVideoBytes += observedPeerConnection.deltaReceivedVideoBytes;
|
|
239
|
-
this.deltaSentAudioBytes += observedPeerConnection.deltaSentAudioBytes;
|
|
240
|
-
this.deltaSentVideoBytes += observedPeerConnection.deltaSentVideoBytes;
|
|
241
|
-
this.availableIncomingBitrate += observedPeerConnection.availableIncomingBitrate;
|
|
242
|
-
this.availableOutgoingBitrate += observedPeerConnection.availableOutgoingBitrate;
|
|
243
|
-
this.numberOfDataChannels += observedPeerConnection.observedDataChannels.size;
|
|
244
|
-
this.numberOfInbundTracks += observedPeerConnection.observedInboundTracks.size;
|
|
245
|
-
this.numberOfOutboundRtpStreams += observedPeerConnection.observedOutboundRtps.size;
|
|
246
|
-
this.numberOfOutboundTracks += observedPeerConnection.observedOutboundTracks.size;
|
|
247
|
-
this.numberOfInboundRtpStreams += observedPeerConnection.observedInboundRtps.size;
|
|
248
196
|
}
|
|
249
197
|
}
|
|
250
198
|
exports.ObservedClient = ObservedClient;
|
|
@@ -15,10 +15,6 @@ export declare class ObservedDataChannel implements DataChannelStats {
|
|
|
15
15
|
messagesReceived?: number | undefined;
|
|
16
16
|
bytesReceived?: number | undefined;
|
|
17
17
|
attachments?: Record<string, unknown> | undefined;
|
|
18
|
-
deltaBytesSent: number;
|
|
19
|
-
deltaBytesReceived: number;
|
|
20
|
-
deltaMessagesSent: number;
|
|
21
|
-
deltaMessagesReceived: number;
|
|
22
18
|
appData?: Record<string, unknown>;
|
|
23
19
|
constructor(timestamp: number, id: string, _peerConnection: ObservedPeerConnection);
|
|
24
20
|
get visited(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObservedDataChannel.d.ts","sourceRoot":"","sources":["../src/ObservedDataChannel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,MAAM,wBAAwB,GAAG,YAAY,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEpF,qBAAa,mBAAoB,YAAW,gBAAgB;
|
|
1
|
+
{"version":3,"file":"ObservedDataChannel.d.ts","sourceRoot":"","sources":["../src/ObservedDataChannel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,MAAM,wBAAwB,GAAG,YAAY,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEpF,qBAAa,mBAAoB,YAAW,gBAAgB;IAgBnD,SAAS,EAAE,MAAM;IACjB,EAAE,EAAE,MAAM;IACjB,OAAO,CAAC,QAAQ,CAAC,eAAe;IAjBjC,OAAO,CAAC,QAAQ,CAAS;IAEzB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,qBAAqB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3C,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IAE3C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;gBAGjC,SAAS,EAAE,MAAM,EACjB,EAAE,EAAE,MAAM,EACA,eAAe,EAAE,sBAAsB;IAIzD,IAAW,OAAO,YAMjB;IAEM,iBAAiB;IAIjB,MAAM,CAAC,KAAK,EAAE,gBAAgB;CAarC"}
|
|
@@ -15,10 +15,6 @@ class ObservedDataChannel {
|
|
|
15
15
|
messagesReceived;
|
|
16
16
|
bytesReceived;
|
|
17
17
|
attachments;
|
|
18
|
-
deltaBytesSent = 0;
|
|
19
|
-
deltaBytesReceived = 0;
|
|
20
|
-
deltaMessagesSent = 0;
|
|
21
|
-
deltaMessagesReceived = 0;
|
|
22
18
|
appData;
|
|
23
19
|
constructor(timestamp, id, _peerConnection) {
|
|
24
20
|
this.timestamp = timestamp;
|
|
@@ -35,30 +31,6 @@ class ObservedDataChannel {
|
|
|
35
31
|
}
|
|
36
32
|
update(stats) {
|
|
37
33
|
this._visited = true;
|
|
38
|
-
if (this.messagesSent && stats.messagesSent && stats.messagesSent >= this.messagesSent) {
|
|
39
|
-
this.deltaMessagesSent = stats.messagesSent - this.messagesSent;
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
this.deltaMessagesSent = 0;
|
|
43
|
-
}
|
|
44
|
-
if (this.messagesReceived && stats.messagesReceived && stats.messagesReceived >= this.messagesReceived) {
|
|
45
|
-
this.deltaMessagesReceived = stats.messagesReceived - this.messagesReceived;
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
this.deltaMessagesReceived = 0;
|
|
49
|
-
}
|
|
50
|
-
if (this.bytesSent && stats.bytesSent && stats.bytesSent >= this.bytesSent) {
|
|
51
|
-
this.deltaBytesSent = stats.bytesSent - this.bytesSent;
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
this.deltaBytesSent = 0;
|
|
55
|
-
}
|
|
56
|
-
if (this.bytesReceived && stats.bytesReceived && stats.bytesReceived >= this.bytesReceived) {
|
|
57
|
-
this.deltaBytesReceived = stats.bytesReceived - this.bytesReceived;
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
this.deltaBytesReceived = 0;
|
|
61
|
-
}
|
|
62
34
|
this.label = stats.label;
|
|
63
35
|
this.protocol = stats.protocol;
|
|
64
36
|
this.dataChannelIdentifier = stats.dataChannelIdentifier;
|
|
@@ -29,10 +29,6 @@ export declare class ObservedIceCandidatePair implements IceCandidatePairStats {
|
|
|
29
29
|
packetsDiscardedOnSend?: number | undefined;
|
|
30
30
|
bytesDiscardedOnSend?: number | undefined;
|
|
31
31
|
attachments?: Record<string, unknown> | undefined;
|
|
32
|
-
deltaBytesSent: number;
|
|
33
|
-
deltaBytesReceived: number;
|
|
34
|
-
deltaPacketsSent: number;
|
|
35
|
-
deltaPacketsReceived: number;
|
|
36
32
|
constructor(timestamp: number, id: string, _peerConnection: ObservedPeerConnection);
|
|
37
33
|
get visited(): boolean;
|
|
38
34
|
getPeerConnection(): ObservedPeerConnection;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObservedIceCandidatePair.d.ts","sourceRoot":"","sources":["../src/ObservedIceCandidatePair.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,qBAAa,wBAAyB,YAAW,qBAAqB;
|
|
1
|
+
{"version":3,"file":"ObservedIceCandidatePair.d.ts","sourceRoot":"","sources":["../src/ObservedIceCandidatePair.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,qBAAa,wBAAyB,YAAW,qBAAqB;IA6B7D,SAAS,EAAE,MAAM;IACjB,EAAE,EAAE,MAAM;IACjB,OAAO,CAAC,QAAQ,CAAC,eAAe;IA9BjC,OAAO,CAAC,QAAQ,CAAS;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEzC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,KAAK,CAAC,EAAE,KAAK,GAAG,YAAY,GAAG,QAAQ,GAAG,WAAW,GAAG,SAAS,CAAC;IAClE,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,uBAAuB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7C,2BAA2B,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjD,kBAAkB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,oBAAoB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,wBAAwB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9C,wBAAwB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9C,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,mBAAmB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,sBAAsB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5C,oBAAoB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;gBAG1C,SAAS,EAAE,MAAM,EACjB,EAAE,EAAE,MAAM,EACA,eAAe,EAAE,sBAAsB;IAIzD,IAAW,OAAO,YAMjB;IAEM,iBAAiB;IAIjB,eAAe;IAIf,iBAAiB;IAIjB,kBAAkB;IAIlB,MAAM,CAAC,KAAK,EAAE,qBAAqB;CA6B1C"}
|
|
@@ -30,10 +30,6 @@ class ObservedIceCandidatePair {
|
|
|
30
30
|
packetsDiscardedOnSend;
|
|
31
31
|
bytesDiscardedOnSend;
|
|
32
32
|
attachments;
|
|
33
|
-
deltaBytesSent = 0;
|
|
34
|
-
deltaBytesReceived = 0;
|
|
35
|
-
deltaPacketsSent = 0;
|
|
36
|
-
deltaPacketsReceived = 0;
|
|
37
33
|
constructor(timestamp, id, _peerConnection) {
|
|
38
34
|
this.timestamp = timestamp;
|
|
39
35
|
this.id = id;
|
|
@@ -58,30 +54,6 @@ class ObservedIceCandidatePair {
|
|
|
58
54
|
}
|
|
59
55
|
update(stats) {
|
|
60
56
|
this._visited = true;
|
|
61
|
-
if (this.packetsSent && stats.packetsSent && stats.packetsSent >= this.packetsSent) {
|
|
62
|
-
this.deltaPacketsSent = stats.packetsSent - this.packetsSent;
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
this.deltaPacketsSent = 0;
|
|
66
|
-
}
|
|
67
|
-
if (this.packetsReceived && stats.packetsReceived && stats.packetsReceived >= this.packetsReceived) {
|
|
68
|
-
this.deltaPacketsReceived = stats.packetsReceived - this.packetsReceived;
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
this.deltaPacketsReceived = 0;
|
|
72
|
-
}
|
|
73
|
-
if (this.bytesSent && stats.bytesSent && stats.bytesSent >= this.bytesSent) {
|
|
74
|
-
this.deltaBytesSent = stats.bytesSent - this.bytesSent;
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
this.deltaBytesSent = 0;
|
|
78
|
-
}
|
|
79
|
-
if (this.bytesReceived && stats.bytesReceived && stats.bytesReceived >= this.bytesReceived) {
|
|
80
|
-
this.deltaBytesReceived = stats.bytesReceived - this.bytesReceived;
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
this.deltaBytesReceived = 0;
|
|
84
|
-
}
|
|
85
57
|
this.timestamp = stats.timestamp;
|
|
86
58
|
this.transportId = stats.transportId;
|
|
87
59
|
this.localCandidateId = stats.localCandidateId;
|
|
@@ -18,7 +18,6 @@ import { ObservedRemoteOutboundRtp } from './ObservedRemoteOutboundRtp';
|
|
|
18
18
|
import { ObservedInboundTrack } from './ObservedInboundTrack';
|
|
19
19
|
import { ObservedOutboundTrack } from './ObservedOutboundTrack';
|
|
20
20
|
import { CalculatedScore } from './scores/CalculatedScore';
|
|
21
|
-
import { ObservedTurnServer } from './ObservedTurnServer';
|
|
22
21
|
export type ObservedPeerConnectionEvents = {
|
|
23
22
|
iceconnectionstatechange: [
|
|
24
23
|
{
|
|
@@ -66,7 +65,6 @@ export type ObservedPeerConnectionEvents = {
|
|
|
66
65
|
'removed-peer-connection-transport': [ObservedPeerConnectionTransport];
|
|
67
66
|
'removed-remote-inbound-rtp': [ObservedRemoteInboundRtp];
|
|
68
67
|
'removed-remote-outbound-rtp': [ObservedRemoteOutboundRtp];
|
|
69
|
-
'update': [];
|
|
70
68
|
close: [];
|
|
71
69
|
};
|
|
72
70
|
export declare interface ObservedPeerConnection {
|
|
@@ -85,15 +83,11 @@ export declare class ObservedPeerConnection extends EventEmitter {
|
|
|
85
83
|
openedAt?: number;
|
|
86
84
|
closedAt?: number;
|
|
87
85
|
updated: number;
|
|
88
|
-
availableIncomingBitrate: number;
|
|
89
|
-
availableOutgoingBitrate: number;
|
|
90
86
|
totalInboundPacketsLost: number;
|
|
91
87
|
totalInboundPacketsReceived: number;
|
|
92
88
|
totalOutboundPacketsSent: number;
|
|
93
89
|
totalDataChannelBytesSent: number;
|
|
94
90
|
totalDataChannelBytesReceived: number;
|
|
95
|
-
totalDataChannelMessagesSent: number;
|
|
96
|
-
totalDataChannelMessagesReceived: number;
|
|
97
91
|
totalSentAudioBytes: number;
|
|
98
92
|
totalSentVideoBytes: number;
|
|
99
93
|
totalSentAudioPackets: number;
|
|
@@ -107,8 +101,6 @@ export declare class ObservedPeerConnection extends EventEmitter {
|
|
|
107
101
|
deltaOutboundPacketsSent: number;
|
|
108
102
|
deltaDataChannelBytesSent: number;
|
|
109
103
|
deltaDataChannelBytesReceived: number;
|
|
110
|
-
deltaDataChannelMessagesSent: number;
|
|
111
|
-
deltaDataChannelMessagesReceived: number;
|
|
112
104
|
deltaInboundReceivedBytes: number;
|
|
113
105
|
deltaOutboundSentBytes: number;
|
|
114
106
|
deltaReceivedAudioBytes: number;
|
|
@@ -127,7 +119,6 @@ export declare class ObservedPeerConnection extends EventEmitter {
|
|
|
127
119
|
avgJitter?: number;
|
|
128
120
|
usingTCP: boolean;
|
|
129
121
|
usingTURN: boolean;
|
|
130
|
-
observedTurnServer?: ObservedTurnServer;
|
|
131
122
|
readonly observedCertificates: Map<string, ObservedCertificate>;
|
|
132
123
|
readonly observedCodecs: Map<string, ObservedCodec>;
|
|
133
124
|
readonly observedDataChannels: Map<string, ObservedDataChannel>;
|
|
@@ -160,7 +151,6 @@ export declare class ObservedPeerConnection extends EventEmitter {
|
|
|
160
151
|
get iceCandidatePairs(): ObservedIceCandidatePair[];
|
|
161
152
|
get certificates(): ObservedCertificate[];
|
|
162
153
|
get selectedIceCandidatePairs(): ObservedIceCandidatePair[];
|
|
163
|
-
get selectedIceCandiadtePairForTurn(): ObservedIceCandidatePair[];
|
|
164
154
|
close(): void;
|
|
165
155
|
accept(sample: PeerConnectionSample): void;
|
|
166
156
|
private _checkVisited;
|