@pexip/peer-connection-stats 17.2.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/CHANGELOG.md +253 -0
- package/LICENSE +188 -0
- package/README.md +9 -0
- package/dist/index.d.ts +325 -0
- package/dist/index.mjs +478 -0
- package/package.json +43 -0
- package/src/index.ts +3 -0
- package/src/statsCollector.ts +665 -0
- package/src/statsCollector.types.ts +233 -0
- package/src/tests/__snapshots__/statsCollector.test.ts.snap +208 -0
- package/src/tests/statsCollector.chrome-inbound-presentation.fixtures.ts +990 -0
- package/src/tests/statsCollector.chrome-multiple.fixtures.ts +2692 -0
- package/src/tests/statsCollector.chrome-outbound-presentation.fixtures.ts +925 -0
- package/src/tests/statsCollector.firefox.fixtures.ts +473 -0
- package/src/tests/statsCollector.test.ts +480 -0
- package/src/utils.ts +41 -0
|
@@ -0,0 +1,473 @@
|
|
|
1
|
+
import type {AnyStats} from '../statsCollector.types';
|
|
2
|
+
|
|
3
|
+
export const statsData: AnyStats[] = [
|
|
4
|
+
{
|
|
5
|
+
id: '70df0599',
|
|
6
|
+
timestamp: 1607359512685,
|
|
7
|
+
type: 'candidate-pair',
|
|
8
|
+
bytesReceived: 0,
|
|
9
|
+
bytesSent: 0,
|
|
10
|
+
lastPacketReceivedTimestamp: 0,
|
|
11
|
+
lastPacketSentTimestamp: 0,
|
|
12
|
+
localCandidateId: '32ac0d0c',
|
|
13
|
+
nominated: false,
|
|
14
|
+
priority: 8774140172997362000,
|
|
15
|
+
readable: true,
|
|
16
|
+
remoteCandidateId: '6479453f',
|
|
17
|
+
selected: false,
|
|
18
|
+
state: 'inprogress',
|
|
19
|
+
transportId: 'transport_0',
|
|
20
|
+
writable: true,
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: 'cb3ebd3b',
|
|
24
|
+
timestamp: 1607359512685,
|
|
25
|
+
type: 'candidate-pair',
|
|
26
|
+
bytesReceived: 0,
|
|
27
|
+
bytesSent: 0,
|
|
28
|
+
lastPacketReceivedTimestamp: 0,
|
|
29
|
+
lastPacketSentTimestamp: 0,
|
|
30
|
+
localCandidateId: 'eab7c196',
|
|
31
|
+
nominated: false,
|
|
32
|
+
priority: 8774140172997231000,
|
|
33
|
+
readable: true,
|
|
34
|
+
remoteCandidateId: '6479453f',
|
|
35
|
+
selected: false,
|
|
36
|
+
state: 'inprogress',
|
|
37
|
+
transportId: 'transport_0',
|
|
38
|
+
writable: true,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: '747cde3e',
|
|
42
|
+
timestamp: 1607359512685,
|
|
43
|
+
type: 'candidate-pair',
|
|
44
|
+
bytesReceived: 5555374,
|
|
45
|
+
bytesSent: 12060851,
|
|
46
|
+
lastPacketReceivedTimestamp: 1607468216444,
|
|
47
|
+
lastPacketSentTimestamp: 1607468216464,
|
|
48
|
+
localCandidateId: '8f940ef2',
|
|
49
|
+
nominated: true,
|
|
50
|
+
priority: 7962083765516764000,
|
|
51
|
+
readable: true,
|
|
52
|
+
remoteCandidateId: '6479453f',
|
|
53
|
+
selected: true,
|
|
54
|
+
state: 'succeeded',
|
|
55
|
+
transportId: 'transport_0',
|
|
56
|
+
writable: true,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
id: '53941a10',
|
|
60
|
+
timestamp: 1607359512685,
|
|
61
|
+
type: 'candidate-pair',
|
|
62
|
+
bytesReceived: 0,
|
|
63
|
+
bytesSent: 0,
|
|
64
|
+
lastPacketReceivedTimestamp: 0,
|
|
65
|
+
lastPacketSentTimestamp: 0,
|
|
66
|
+
localCandidateId: '8f940ef2',
|
|
67
|
+
nominated: true,
|
|
68
|
+
priority: 7961802290540054000,
|
|
69
|
+
readable: true,
|
|
70
|
+
remoteCandidateId: '6479453f',
|
|
71
|
+
selected: false,
|
|
72
|
+
state: 'succeeded',
|
|
73
|
+
transportId: 'transport_0',
|
|
74
|
+
writable: true,
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
id: 'f95809af',
|
|
78
|
+
timestamp: 1607359512685,
|
|
79
|
+
type: 'candidate-pair',
|
|
80
|
+
bytesReceived: 0,
|
|
81
|
+
bytesSent: 0,
|
|
82
|
+
lastPacketReceivedTimestamp: 0,
|
|
83
|
+
lastPacketSentTimestamp: 0,
|
|
84
|
+
localCandidateId: '85c269b',
|
|
85
|
+
nominated: false,
|
|
86
|
+
priority: 3676066494292132400,
|
|
87
|
+
readable: true,
|
|
88
|
+
remoteCandidateId: '62b88a85',
|
|
89
|
+
selected: false,
|
|
90
|
+
state: 'cancelled',
|
|
91
|
+
transportId: 'transport_0',
|
|
92
|
+
writable: true,
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
id: 'fbd8e264',
|
|
96
|
+
timestamp: 1607359512685,
|
|
97
|
+
type: 'candidate-pair',
|
|
98
|
+
bytesReceived: 0,
|
|
99
|
+
bytesSent: 0,
|
|
100
|
+
lastPacketReceivedTimestamp: 0,
|
|
101
|
+
lastPacketSentTimestamp: 0,
|
|
102
|
+
localCandidateId: 'c715fb9b',
|
|
103
|
+
nominated: false,
|
|
104
|
+
priority: 3676066494292001300,
|
|
105
|
+
readable: true,
|
|
106
|
+
remoteCandidateId: '62b88a85',
|
|
107
|
+
selected: false,
|
|
108
|
+
state: 'cancelled',
|
|
109
|
+
transportId: 'transport_0',
|
|
110
|
+
writable: true,
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
id: '92d8e29c',
|
|
114
|
+
timestamp: 1607359512685,
|
|
115
|
+
type: 'candidate-pair',
|
|
116
|
+
bytesReceived: 0,
|
|
117
|
+
bytesSent: 0,
|
|
118
|
+
lastPacketReceivedTimestamp: 0,
|
|
119
|
+
lastPacketSentTimestamp: 0,
|
|
120
|
+
localCandidateId: 'efec9d54',
|
|
121
|
+
nominated: false,
|
|
122
|
+
priority: 8774140172997362000,
|
|
123
|
+
readable: true,
|
|
124
|
+
remoteCandidateId: '4af8c58e',
|
|
125
|
+
selected: false,
|
|
126
|
+
state: 'inprogress',
|
|
127
|
+
transportId: 'transport_1',
|
|
128
|
+
writable: true,
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
id: 'd4d8f4af',
|
|
132
|
+
timestamp: 1607359512685,
|
|
133
|
+
type: 'candidate-pair',
|
|
134
|
+
bytesReceived: 0,
|
|
135
|
+
bytesSent: 0,
|
|
136
|
+
lastPacketReceivedTimestamp: 0,
|
|
137
|
+
lastPacketSentTimestamp: 0,
|
|
138
|
+
localCandidateId: '93fefccb',
|
|
139
|
+
nominated: false,
|
|
140
|
+
priority: 8774140172997231000,
|
|
141
|
+
readable: true,
|
|
142
|
+
remoteCandidateId: '4af8c58e',
|
|
143
|
+
selected: false,
|
|
144
|
+
state: 'cancelled',
|
|
145
|
+
transportId: 'transport_1',
|
|
146
|
+
writable: true,
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
id: '367faebf',
|
|
150
|
+
timestamp: 1607359512685,
|
|
151
|
+
type: 'candidate-pair',
|
|
152
|
+
bytesReceived: 415969,
|
|
153
|
+
bytesSent: 163308,
|
|
154
|
+
lastPacketReceivedTimestamp: 1607468216459,
|
|
155
|
+
lastPacketSentTimestamp: 1607468216456,
|
|
156
|
+
localCandidateId: '8f940ef2',
|
|
157
|
+
nominated: true,
|
|
158
|
+
priority: 7962083765516764000,
|
|
159
|
+
readable: true,
|
|
160
|
+
remoteCandidateId: '4af8c58e',
|
|
161
|
+
selected: true,
|
|
162
|
+
state: 'succeeded',
|
|
163
|
+
transportId: 'transport_1',
|
|
164
|
+
writable: true,
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
id: 'd43ca551',
|
|
168
|
+
timestamp: 1607359512685,
|
|
169
|
+
type: 'candidate-pair',
|
|
170
|
+
bytesReceived: 0,
|
|
171
|
+
bytesSent: 0,
|
|
172
|
+
lastPacketReceivedTimestamp: 0,
|
|
173
|
+
lastPacketSentTimestamp: 0,
|
|
174
|
+
localCandidateId: 'ec5c247d',
|
|
175
|
+
nominated: false,
|
|
176
|
+
priority: 3676066494292132400,
|
|
177
|
+
readable: true,
|
|
178
|
+
remoteCandidateId: '53c089e',
|
|
179
|
+
selected: false,
|
|
180
|
+
state: 'cancelled',
|
|
181
|
+
transportId: 'transport_1',
|
|
182
|
+
writable: true,
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
id: '5f7cb429',
|
|
186
|
+
timestamp: 1607359512685,
|
|
187
|
+
type: 'candidate-pair',
|
|
188
|
+
bytesReceived: 0,
|
|
189
|
+
bytesSent: 0,
|
|
190
|
+
lastPacketReceivedTimestamp: 0,
|
|
191
|
+
lastPacketSentTimestamp: 0,
|
|
192
|
+
localCandidateId: '465c49cb',
|
|
193
|
+
nominated: false,
|
|
194
|
+
priority: 3676066494292001300,
|
|
195
|
+
readable: true,
|
|
196
|
+
remoteCandidateId: '53c089e',
|
|
197
|
+
selected: false,
|
|
198
|
+
state: 'cancelled',
|
|
199
|
+
transportId: 'transport_1',
|
|
200
|
+
writable: true,
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
id: 'eab7c196',
|
|
204
|
+
timestamp: 1607359512685,
|
|
205
|
+
type: 'local-candidate',
|
|
206
|
+
address: '192.168.1.23',
|
|
207
|
+
candidateType: 'host',
|
|
208
|
+
port: 40524,
|
|
209
|
+
priority: 2122187007,
|
|
210
|
+
protocol: 'udp',
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
id: '32ac0d0c',
|
|
214
|
+
timestamp: 1607359512685,
|
|
215
|
+
type: 'local-candidate',
|
|
216
|
+
address: '192.168.122.1',
|
|
217
|
+
candidateType: 'host',
|
|
218
|
+
port: 35588,
|
|
219
|
+
priority: 2122252543,
|
|
220
|
+
protocol: 'udp',
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
id: 'c715fb9b',
|
|
224
|
+
timestamp: 1607359512685,
|
|
225
|
+
type: 'local-candidate',
|
|
226
|
+
address: '192.168.1.23',
|
|
227
|
+
candidateType: 'host',
|
|
228
|
+
port: 51647,
|
|
229
|
+
priority: 2105458943,
|
|
230
|
+
protocol: 'tcp',
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
id: '85c269b',
|
|
234
|
+
timestamp: 1607359512685,
|
|
235
|
+
type: 'local-candidate',
|
|
236
|
+
address: '192.168.122.1',
|
|
237
|
+
candidateType: 'host',
|
|
238
|
+
port: 49524,
|
|
239
|
+
priority: 2105524479,
|
|
240
|
+
protocol: 'tcp',
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
id: '8f940ef2',
|
|
244
|
+
timestamp: 1607359512685,
|
|
245
|
+
type: 'local-candidate',
|
|
246
|
+
address: '45.152.51.102',
|
|
247
|
+
candidateType: 'prflx',
|
|
248
|
+
port: 55186,
|
|
249
|
+
priority: 1853817087,
|
|
250
|
+
protocol: 'udp',
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
id: '6479453f',
|
|
254
|
+
timestamp: 1607359512685,
|
|
255
|
+
type: 'remote-candidate',
|
|
256
|
+
address: '34.91.46.168',
|
|
257
|
+
candidateType: 'host',
|
|
258
|
+
port: 40166,
|
|
259
|
+
priority: 2042888703,
|
|
260
|
+
protocol: 'udp',
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
id: '62b88a85',
|
|
264
|
+
timestamp: 1607359512685,
|
|
265
|
+
type: 'remote-candidate',
|
|
266
|
+
address: '34.91.46.168',
|
|
267
|
+
candidateType: 'host',
|
|
268
|
+
port: 40166,
|
|
269
|
+
priority: 855900927,
|
|
270
|
+
protocol: 'tcp',
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
id: 'fbec0791',
|
|
274
|
+
timestamp: 1607359512685,
|
|
275
|
+
type: 'remote-candidate',
|
|
276
|
+
address: '34.91.46.168',
|
|
277
|
+
candidateType: 'host',
|
|
278
|
+
port: 40166,
|
|
279
|
+
priority: 864289791,
|
|
280
|
+
protocol: 'tcp',
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
id: '93fefccb',
|
|
284
|
+
timestamp: 1607359512685,
|
|
285
|
+
type: 'local-candidate',
|
|
286
|
+
address: '192.168.1.23',
|
|
287
|
+
candidateType: 'host',
|
|
288
|
+
port: 37715,
|
|
289
|
+
priority: 2122187007,
|
|
290
|
+
protocol: 'udp',
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
id: 'efec9d54',
|
|
294
|
+
timestamp: 1607359512685,
|
|
295
|
+
type: 'local-candidate',
|
|
296
|
+
address: '192.168.122.1',
|
|
297
|
+
candidateType: 'host',
|
|
298
|
+
port: 55186,
|
|
299
|
+
priority: 2122252543,
|
|
300
|
+
protocol: 'udp',
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
id: '465c49cb',
|
|
304
|
+
timestamp: 1607359512685,
|
|
305
|
+
type: 'local-candidate',
|
|
306
|
+
address: '192.168.1.23',
|
|
307
|
+
candidateType: 'host',
|
|
308
|
+
port: 53452,
|
|
309
|
+
priority: 2105458943,
|
|
310
|
+
protocol: 'tcp',
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
id: 'ec5c247d',
|
|
314
|
+
timestamp: 1607359512685,
|
|
315
|
+
type: 'local-candidate',
|
|
316
|
+
address: '192.168.122.1',
|
|
317
|
+
candidateType: 'host',
|
|
318
|
+
port: 60325,
|
|
319
|
+
priority: 2105524479,
|
|
320
|
+
protocol: 'tcp',
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
id: '4af8c58e',
|
|
324
|
+
timestamp: 1607359512685,
|
|
325
|
+
type: 'remote-candidate',
|
|
326
|
+
address: '34.91.46.168',
|
|
327
|
+
candidateType: 'host',
|
|
328
|
+
port: 40186,
|
|
329
|
+
priority: 2042888703,
|
|
330
|
+
protocol: 'udp',
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
id: '53c089e',
|
|
334
|
+
timestamp: 1607359512685,
|
|
335
|
+
type: 'remote-candidate',
|
|
336
|
+
address: '34.91.46.168',
|
|
337
|
+
candidateType: 'host',
|
|
338
|
+
port: 40186,
|
|
339
|
+
priority: 855900927,
|
|
340
|
+
protocol: 'tcp',
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
id: '58f0027f',
|
|
344
|
+
timestamp: 1607359512685,
|
|
345
|
+
type: 'remote-candidate',
|
|
346
|
+
address: '34.91.46.168',
|
|
347
|
+
candidateType: 'host',
|
|
348
|
+
port: 40186,
|
|
349
|
+
priority: 864289791,
|
|
350
|
+
protocol: 'tcp',
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
id: '8adcb9ce',
|
|
354
|
+
timestamp: 1607359512687,
|
|
355
|
+
type: 'inbound-rtp',
|
|
356
|
+
kind: 'video',
|
|
357
|
+
mediaType: 'video',
|
|
358
|
+
ssrc: 840745016,
|
|
359
|
+
discardedPackets: 0,
|
|
360
|
+
jitter: 0.014,
|
|
361
|
+
packetsLost: 0,
|
|
362
|
+
packetsReceived: 4666,
|
|
363
|
+
bitrateMean: 789199.2641509434,
|
|
364
|
+
bitrateStdDev: 172342.0917917606,
|
|
365
|
+
bytesReceived: 5215634,
|
|
366
|
+
firCount: 0,
|
|
367
|
+
framerateMean: 24.03773584905661,
|
|
368
|
+
framerateStdDev: 4.823668665074425,
|
|
369
|
+
framesDecoded: 1263,
|
|
370
|
+
nackCount: 0,
|
|
371
|
+
pliCount: 1,
|
|
372
|
+
remoteId: '7b317e3f',
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
id: 'b7b8198b',
|
|
376
|
+
timestamp: 1607359512687,
|
|
377
|
+
type: 'inbound-rtp',
|
|
378
|
+
kind: 'audio',
|
|
379
|
+
mediaType: 'audio',
|
|
380
|
+
ssrc: 3376419831,
|
|
381
|
+
jitter: 0,
|
|
382
|
+
packetsLost: 0,
|
|
383
|
+
packetsReceived: 2563,
|
|
384
|
+
bytesReceived: 371213,
|
|
385
|
+
nackCount: 0,
|
|
386
|
+
remoteId: 'e1a8cb41',
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
id: '9b81861',
|
|
390
|
+
timestamp: 1607359512686,
|
|
391
|
+
type: 'outbound-rtp',
|
|
392
|
+
kind: 'video',
|
|
393
|
+
mediaType: 'video',
|
|
394
|
+
ssrc: 678033974,
|
|
395
|
+
bytesSent: 11840687,
|
|
396
|
+
packetsSent: 10663,
|
|
397
|
+
bitrateMean: 1730236.3773584904,
|
|
398
|
+
bitrateStdDev: 434797.7326515535,
|
|
399
|
+
droppedFrames: 4,
|
|
400
|
+
firCount: 0,
|
|
401
|
+
framerateMean: 28.999999999999993,
|
|
402
|
+
framerateStdDev: 5.844129204068486,
|
|
403
|
+
framesEncoded: 1512,
|
|
404
|
+
nackCount: 0,
|
|
405
|
+
pliCount: 0,
|
|
406
|
+
qpSum: 89087,
|
|
407
|
+
remoteId: 'b39ceeda',
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
id: '9b74fd1c',
|
|
411
|
+
timestamp: 1607359512687,
|
|
412
|
+
type: 'outbound-rtp',
|
|
413
|
+
kind: 'audio',
|
|
414
|
+
mediaType: 'audio',
|
|
415
|
+
ssrc: 3453750983,
|
|
416
|
+
bytesSent: 120316,
|
|
417
|
+
packetsSent: 2560,
|
|
418
|
+
nackCount: 0,
|
|
419
|
+
remoteId: '8471050b',
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
id: 'b39ceeda',
|
|
423
|
+
timestamp: 1607359512666,
|
|
424
|
+
type: 'remote-inbound-rtp',
|
|
425
|
+
kind: 'video',
|
|
426
|
+
mediaType: 'video',
|
|
427
|
+
ssrc: 678033974,
|
|
428
|
+
jitter: 0.002,
|
|
429
|
+
packetsLost: 0,
|
|
430
|
+
packetsReceived: 10497,
|
|
431
|
+
bytesReceived: 11445691,
|
|
432
|
+
localId: '9b81861',
|
|
433
|
+
roundTripTime: 0.033,
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
id: '8471050b',
|
|
437
|
+
timestamp: 1607359510713,
|
|
438
|
+
type: 'remote-inbound-rtp',
|
|
439
|
+
kind: 'audio',
|
|
440
|
+
mediaType: 'audio',
|
|
441
|
+
ssrc: 3453750983,
|
|
442
|
+
jitter: 0,
|
|
443
|
+
packetsLost: 0,
|
|
444
|
+
packetsReceived: 2232,
|
|
445
|
+
bytesReceived: 78116,
|
|
446
|
+
localId: '9b74fd1c',
|
|
447
|
+
roundTripTime: 0.033,
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
id: '7b317e3f',
|
|
451
|
+
timestamp: 1607359512666,
|
|
452
|
+
type: 'remote-outbound-rtp',
|
|
453
|
+
kind: 'video',
|
|
454
|
+
mediaType: 'video',
|
|
455
|
+
ssrc: 840745016,
|
|
456
|
+
bytesSent: 5305963,
|
|
457
|
+
packetsSent: 4805,
|
|
458
|
+
localId: '8adcb9ce',
|
|
459
|
+
remoteTimestamp: 3816457015643,
|
|
460
|
+
},
|
|
461
|
+
{
|
|
462
|
+
id: 'e1a8cb41',
|
|
463
|
+
timestamp: 1607359510713,
|
|
464
|
+
type: 'remote-outbound-rtp',
|
|
465
|
+
kind: 'audio',
|
|
466
|
+
mediaType: 'audio',
|
|
467
|
+
ssrc: 3376419831,
|
|
468
|
+
bytesSent: 347333,
|
|
469
|
+
packetsSent: 2617,
|
|
470
|
+
localId: 'b7b8198b',
|
|
471
|
+
remoteTimestamp: 3816457014478,
|
|
472
|
+
},
|
|
473
|
+
];
|