Skip to content

Commit

Permalink
Merge branch 'dev' into chore/update-inline-code-comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ygit committed Dec 2, 2024
2 parents 2b3deb0 + 2e8fee4 commit a2ad7ab
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ export class DiagnosticsStatsCollector {
const ridAveragedVideoBitrateList = this.localVideoTrackStatsList.map(trackStatsMap =>
trackStatsMap ? calculateAverage(Object.values(trackStatsMap), curr => curr.bitrate) : 0,
);

const audioJitter = getLastElement(this.remoteAudioTrackStatsList)?.jitter || 0;
const videoJitter = getLastElement(this.remoteVideoTrackStatsList)?.jitter || 0;
const jitter = Math.max(audioJitter, videoJitter);
const lastLocalAudioTrackStats = getLastElement(this.localAudioTrackStatsList);
const lastLocalVideoTrackStats = getLastElement(this.localVideoTrackStatsList);

Expand All @@ -80,6 +82,7 @@ export class DiagnosticsStatsCollector {
bytesReceived: lastSubscribeStats?.bytesReceived || 0,
bitrateSent: calculateAverage(this.peerStatsList, curr => curr.publish?.bitrate),
bitrateReceived: calculateAverage(this.peerStatsList, curr => curr.subscribe?.bitrate),
jitter: jitter,
},
audio: {
roundTripTime,
Expand All @@ -91,6 +94,7 @@ export class DiagnosticsStatsCollector {
bytesSent: lastLocalAudioTrackStats
? Object.values(lastLocalAudioTrackStats).reduce((acc, curr) => acc + (curr.bytesSent || 0), 0)
: 0,
jitter: audioJitter,
},
video: {
roundTripTime,
Expand All @@ -102,6 +106,7 @@ export class DiagnosticsStatsCollector {
bytesSent: lastLocalVideoTrackStats
? Object.values(lastLocalVideoTrackStats).reduce((acc, curr) => acc + (curr.bytesSent || 0), 0)
: 0,
jitter: videoJitter,
},
};
}
Expand Down
1 change: 1 addition & 0 deletions packages/hms-video-store/src/diagnostics/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,5 @@ export interface DiagnosticsRTCStats {
bitrateSent: number;
bitrateReceived: number;
roundTripTime: number;
jitter: number;
}
2 changes: 1 addition & 1 deletion packages/roomkit-react/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions packages/roomkit-react/src/Diagnostics/ConnectivityTest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ const AudioStats = ({ stats }: { stats: DiagnosticsRTCStats | undefined }) => {
<DetailedInfo title="Bitrate Sent" value={formatBytes(stats.bitrateSent, 'b/s')} />
<DetailedInfo title="Bitrate Received" value={formatBytes(stats.bitrateReceived, 'b/s')} />
<DetailedInfo title="Round Trip Time" value={`${stats.roundTripTime} ms`} />
<DetailedInfo title="Jitter" value={`${stats.jitter} s`} />
</Flex>
)}
</ConnectivityTestStepResult>
Expand All @@ -182,6 +183,7 @@ const VideoStats = ({ stats }: { stats: DiagnosticsRTCStats | undefined }) => {
<DetailedInfo title="Bitrate Sent" value={formatBytes(stats.bitrateSent, 'b/s')} />
<DetailedInfo title="Bitrate Received" value={formatBytes(stats.bitrateReceived, 'b/s')} />
<DetailedInfo title="Round Trip Time" value={`${stats.roundTripTime} ms`} />
<DetailedInfo title="Jitter" value={`${stats.jitter} s`} />
</Flex>
)}
</ConnectivityTestStepResult>
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# yarn lockfile v1


"@100mslive/[email protected].1":
version "0.0.1"
resolved "https://registry.yarnpkg.com/@100mslive/hms-noise-cancellation/-/hms-noise-cancellation-0.0.1.tgz#037c8bdfb6b2d7bf12f9d257422150fe6ca43acb"
integrity sha512-DGnzcXRDJREWypIjGX70er+f2k/XLLRF41lrXPs1+PtB1imdEkECPPS0Fg4BA0BCWKDNAGTZBHZPrBDgUmr9Lw==
"@100mslive/[email protected].2-alpha.8":
version "0.0.2-alpha.8"
resolved "https://registry.yarnpkg.com/@100mslive/hms-noise-cancellation/-/hms-noise-cancellation-0.0.2-alpha.8.tgz#0cdd4801ad0a85e7c09ad7fe760840d897619ba3"
integrity sha512-1NKK3P+8Mb/lQMuDu3+VOEwFjMhGD5yiz94C6c2yVpv7/q3n6XDbkdTycnmWNpoOqW5AfMPr8DtxD/dYQkhUOA==

"@100mslive/[email protected]":
version "0.12.12"
Expand Down

0 comments on commit a2ad7ab

Please sign in to comment.