From e6a3b0ebc035ca79fe55de1b3c3aaafc87fba30e Mon Sep 17 00:00:00 2001 From: Timo <16718859+toger5@users.noreply.github.com> Date: Sun, 14 May 2023 18:58:38 +0200 Subject: [PATCH] Total summary count (#3351) * add audio concealment to stats report * audio concealment to summary * make ts linter happy * format and rename * fix and add tests * make it prettier! * we can make it even prettier ?! * review * fix tests * pretty * one empty line to ... * remove ratio in audio concealment (ratio is now done in the summary) * remove comment * fix test * add peer connections to summary report * tests --- spec/unit/webrtc/stats/summaryStatsReporter.spec.ts | 8 ++++++++ src/webrtc/stats/statsReport.ts | 1 + src/webrtc/stats/summaryStatsReporter.ts | 1 + 3 files changed, 10 insertions(+) diff --git a/spec/unit/webrtc/stats/summaryStatsReporter.spec.ts b/spec/unit/webrtc/stats/summaryStatsReporter.spec.ts index 117231ee2..22c7f60c3 100644 --- a/spec/unit/webrtc/stats/summaryStatsReporter.spec.ts +++ b/spec/unit/webrtc/stats/summaryStatsReporter.spec.ts @@ -125,6 +125,7 @@ describe("SummaryStatsReporter", () => { percentageReceivedVideoMedia: 0.75, maxJitter: 0, maxPacketLoss: 0, + peerConnections: 4, percentageConcealedAudio: 0.0375, }); }); @@ -160,6 +161,7 @@ describe("SummaryStatsReporter", () => { percentageReceivedVideoMedia: 1, maxJitter: 0, maxPacketLoss: 0, + peerConnections: 1, percentageConcealedAudio: 0, }); }); @@ -195,6 +197,7 @@ describe("SummaryStatsReporter", () => { percentageReceivedVideoMedia: 0, maxJitter: 0, maxPacketLoss: 0, + peerConnections: 1, percentageConcealedAudio: 0, }); }); @@ -230,6 +233,7 @@ describe("SummaryStatsReporter", () => { percentageReceivedVideoMedia: 1, maxJitter: 0, maxPacketLoss: 0, + peerConnections: 1, percentageConcealedAudio: 0, }); }); @@ -328,6 +332,7 @@ describe("SummaryStatsReporter", () => { percentageReceivedVideoMedia: 1, maxJitter: 20, maxPacketLoss: 40, + peerConnections: 4, percentageConcealedAudio: 0, }); }); @@ -363,6 +368,7 @@ describe("SummaryStatsReporter", () => { percentageReceivedVideoMedia: 1, maxJitter: 0, maxPacketLoss: 0, + peerConnections: 1, percentageConcealedAudio: 0, }); }); @@ -398,6 +404,7 @@ describe("SummaryStatsReporter", () => { percentageReceivedVideoMedia: 1, maxJitter: 0, maxPacketLoss: 0, + peerConnections: 1, percentageConcealedAudio: 0, }); }); @@ -433,6 +440,7 @@ describe("SummaryStatsReporter", () => { percentageReceivedVideoMedia: 1, maxJitter: 0, maxPacketLoss: 0, + peerConnections: 1, percentageConcealedAudio: 0, }); }); diff --git a/src/webrtc/stats/statsReport.ts b/src/webrtc/stats/statsReport.ts index 67fd3513b..cdfa751f4 100644 --- a/src/webrtc/stats/statsReport.ts +++ b/src/webrtc/stats/statsReport.ts @@ -78,4 +78,5 @@ export interface SummaryStatsReport { maxJitter: number; maxPacketLoss: number; percentageConcealedAudio: number; + peerConnections: number; } diff --git a/src/webrtc/stats/summaryStatsReporter.ts b/src/webrtc/stats/summaryStatsReporter.ts index 8ad0c5591..7fd594c50 100644 --- a/src/webrtc/stats/summaryStatsReporter.ts +++ b/src/webrtc/stats/summaryStatsReporter.ts @@ -61,6 +61,7 @@ export class SummaryStatsReporter { ? (summaryCounter.concealedAudio / summaryCounter.totalAudio).toFixed(decimalPlaces) : 0, ), + peerConnections: summaryTotalCount, } as SummaryStatsReport; this.emitter.emitSummaryStatsReport(report); }