@observertc/observer-js 0.9.3-beta → 0.9.4-beta
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/middlewares/visitors/visitPeerConnection.d.ts.map +1 -1
- package/lib/middlewares/visitors/visitPeerConnection.js +32 -3
- package/lib/models/Models.d.ts +7 -3
- package/lib/models/Models.d.ts.map +1 -1
- package/lib/models/Models.js +136 -149
- package/lib/models/samples_pb.d.ts +2 -2
- package/lib/models/samples_pb.d.ts.map +1 -1
- package/lib/models/samples_pb.js +538 -586
- package/package.json +1 -1
- package/src/middlewares/visitors/visitPeerConnection.ts +50 -3
- package/src/models/Models.ts +986 -1037
- package/src/models/samples_pb.ts +3858 -4047
package/package.json
CHANGED
|
@@ -3,6 +3,7 @@ import * as Models from '../../models/Models';
|
|
|
3
3
|
import { ReportsCollector } from '../../common/ReportsCollector';
|
|
4
4
|
import { logger } from '../VisitObservedCallsMiddleware';
|
|
5
5
|
import { PeerConnectionTransportReport } from '@observertc/report-schemas-js';
|
|
6
|
+
import { Samples_ClientSample_IceCandidatePair, Samples_ClientSample_IceLocalCandidate, Samples_ClientSample_IceRemoteCandidate, Samples_ClientSample_PeerConnectionTransport } from '../../models/samples_pb';
|
|
6
7
|
|
|
7
8
|
export function visitPeerConnection(
|
|
8
9
|
observedPeerConnection: ObservedPeerConnection,
|
|
@@ -55,16 +56,62 @@ export function visitPeerConnection(
|
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
if (fetchSamples) {
|
|
59
|
+
storedPeerConnection.icelocalCandidates = [];
|
|
58
60
|
for (const iceLocalCandidate of observedPeerConnection.iceLocalCandidates()) {
|
|
59
|
-
|
|
61
|
+
const {
|
|
62
|
+
priority,
|
|
63
|
+
...sample
|
|
64
|
+
} = iceLocalCandidate;
|
|
65
|
+
storedPeerConnection.icelocalCandidates.push(new Samples_ClientSample_IceLocalCandidate({
|
|
66
|
+
...sample,
|
|
67
|
+
priority: BigInt(priority ?? -1)
|
|
68
|
+
}));
|
|
60
69
|
}
|
|
61
70
|
|
|
71
|
+
storedPeerConnection.iceRemoteCandidates = [];
|
|
62
72
|
for (const iceRemoteCandidate of observedPeerConnection.iceRemoteCandidates()) {
|
|
63
|
-
|
|
73
|
+
const {
|
|
74
|
+
priority,
|
|
75
|
+
...sample
|
|
76
|
+
} = iceRemoteCandidate;
|
|
77
|
+
storedPeerConnection.iceRemoteCandidates.push(new Samples_ClientSample_IceRemoteCandidate({
|
|
78
|
+
...sample,
|
|
79
|
+
priority: BigInt(priority ?? -1)
|
|
80
|
+
}));
|
|
64
81
|
}
|
|
65
82
|
|
|
83
|
+
storedPeerConnection.iceCandidatePairs = [];
|
|
66
84
|
for (const iceCandidatePair of observedPeerConnection.iceCandidatePairs()) {
|
|
67
|
-
|
|
85
|
+
const {
|
|
86
|
+
bytesDiscardedOnSend,
|
|
87
|
+
bytesReceived,
|
|
88
|
+
bytesSent,
|
|
89
|
+
lastPacketReceivedTimestamp,
|
|
90
|
+
lastPacketSentTimestamp,
|
|
91
|
+
...sample
|
|
92
|
+
} = iceCandidatePair;
|
|
93
|
+
storedPeerConnection.iceCandidatePairs.push(new Samples_ClientSample_IceCandidatePair({
|
|
94
|
+
...sample,
|
|
95
|
+
bytesDiscardedOnSend: BigInt(bytesDiscardedOnSend ?? -1),
|
|
96
|
+
bytesReceived: BigInt(bytesReceived ?? -1),
|
|
97
|
+
bytesSent: BigInt(bytesSent ?? -1),
|
|
98
|
+
lastPacketReceivedTimestamp: BigInt(lastPacketReceivedTimestamp ?? -1),
|
|
99
|
+
lastPacketSentTimestamp: BigInt(lastPacketSentTimestamp ?? -1),
|
|
100
|
+
}));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
storedPeerConnection.transports = [];
|
|
104
|
+
for (const pcTransport of observedPeerConnection.transportSamples()) {
|
|
105
|
+
const {
|
|
106
|
+
bytesReceived,
|
|
107
|
+
bytesSent,
|
|
108
|
+
...sample
|
|
109
|
+
} = pcTransport;
|
|
110
|
+
storedPeerConnection.transports.push(new Samples_ClientSample_PeerConnectionTransport({
|
|
111
|
+
...sample,
|
|
112
|
+
bytesReceived: BigInt(bytesReceived ?? -1),
|
|
113
|
+
bytesSent: BigInt(bytesSent ?? -1),
|
|
114
|
+
}));
|
|
68
115
|
}
|
|
69
116
|
}
|
|
70
117
|
}
|