Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
balazskreith committed Mar 16, 2024
1 parent 94a3e00 commit 16dcde4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 23 deletions.
11 changes: 4 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@observertc/observer-js",
"version": "0.40.7-beta",
"version": "0.40.8-beta",
"description": "Server Side NodeJS Library for processing ObserveRTC Samples",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand All @@ -18,9 +18,8 @@
},
"keywords": [
"webrtc",
"getStats",
"observertc",
"client",
"server",
"integration"
],
"author": "Balazs Kreith",
Expand All @@ -29,17 +28,15 @@
"@bufbuild/protobuf": "1.1.1",
"@observertc/report-schemas-js": "2.2.10",
"@observertc/sample-schemas-js": "2.2.10",
"@types/events": "^3.0.0",
"@types/uuid": "^8.3.4",
"ipaddr.js": "^2.1.0",
"package-lock-only": "^0.0.4",
"uuid": "^8.3.2"
},
"devDependencies": {
"@types/jest": "^27.5.2",
"@types/node": "^20.9.0",
"@typescript-eslint/eslint-plugin": "^5.38.0",
"@typescript-eslint/parser": "^5.38.0",
"@types/events": "^3.0.0",
"@types/uuid": "^8.3.4",
"bufferutil": "^4.0.6",
"eslint": "^8.24.0",
"jest": "^27.5.0",
Expand Down
9 changes: 6 additions & 3 deletions src/ObservedClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,7 @@ export class ObservedClient<AppData extends Record<string, unknown> = Record<str
this.inboundAudioBitrate = 0;
this.inboundVideoBitrate = 0;
let sumRttInMs = 0;
let anyPeerConnectionUsingTurn = false;

for (const peerConnection of this._peerConnections.values()) {
if (peerConnection.closed) continue;
Expand All @@ -732,9 +733,13 @@ export class ObservedClient<AppData extends Record<string, unknown> = Record<str

sumRttInMs += peerConnection.avgRttInMs ?? 0;

if (peerConnection.usingTURN) this.usingTURN = true;
anyPeerConnectionUsingTurn ||= peerConnection.usingTURN;
}

this.usingTURN = anyPeerConnectionUsingTurn === true;

if (wasUsingTURN !== this.usingTURN) this.emit('usingturn', this.usingTURN);

this.totalSentBytes += this.deltaSentAudioBytes + this.deltaSentVideoBytes;
this.totalReceivedBytes += this.deltaReceivedAudioBytes + this.deltaReceivedVideoBytes;
this.totalReceivedAudioBytes += this.deltaReceivedAudioBytes;
Expand All @@ -754,8 +759,6 @@ export class ObservedClient<AppData extends Record<string, unknown> = Record<str

this.avgRttInMs = this._peerConnections.size ? sumRttInMs / this._peerConnections.size : undefined;

if (wasUsingTURN !== this.usingTURN) this.emit('usingturn', this.usingTURN);

this._updated = now;
this.emit('update');
}
Expand Down
14 changes: 1 addition & 13 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,7 @@ caniuse-lite@^1.0.30001449:
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001481.tgz#f58a717afe92f9e69d0e35ff64df596bfad93912"
integrity sha512-KCqHwRnaa1InZBtqXzP98LPg0ajCVujMKjqKDhZEthIpAsJl/YEIa3YvXjGXPVqzZVguccuu7ga9KOE1J9rKPQ==

chalk@^2.0.0, chalk@^2.4.1:
chalk@^2.0.0:
version "2.4.2"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
Expand Down Expand Up @@ -1805,11 +1805,6 @@ inherits@2, inherits@~2.0.0:
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==

ipaddr.js@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-2.1.0.tgz#2119bc447ff8c257753b196fc5f1ce08a4cdf39f"
integrity sha512-LlbxQ7xKzfBusov6UMi4MFpEg0m+mAm9xyNGEduwXMEDuf4WfzB/RZwMVYEd7IKGvh4IUkEXYxtAVu9T3OelJQ==

is-arrayish@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d"
Expand Down Expand Up @@ -2683,13 +2678,6 @@ p-try@^2.0.0:
resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6"
integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==

package-lock-only@^0.0.4:
version "0.0.4"
resolved "https://registry.yarnpkg.com/package-lock-only/-/package-lock-only-0.0.4.tgz#5cf4f379d54d0f3d18d50c92e54d92e177f2f754"
integrity sha512-fV1YHeTMWH5LKmdVqfWskm2/SG0iF2IrxJn3ziaPVx9CnpecGJzt8xXtLV+CYINENZwPFMtbxO5qupz0asNz1A==
dependencies:
chalk "^2.4.1"

parent-module@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2"
Expand Down

0 comments on commit 16dcde4

Please sign in to comment.