Skip to content

Commit

Permalink
add packets lost stat
Browse files Browse the repository at this point in the history
  • Loading branch information
vpalmisano committed Jan 16, 2024
1 parent 5b1361e commit 96c8eb0
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions src/rtcstats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ export enum RtcStatsMetricNames {
audioRecvJitter = 'audioRecvJitter',
audioRecvRoundTripTime = 'audioRecvRoundTripTime',
audioRecvPackets = 'audioRecvPackets',
audioRecvPacketsLost = 'audioRecvPacketsLost',
audioRecvPacketsLost = 'audioRecvPacketsLost', // TODO: remove this.
audioRecvLostPackets = 'audioRecvLostPackets',
audioRecvPacketsLossRate = 'audioRecvPacketsLossRate',
audioRecvRetransmittedPackets = 'audioRecvRetransmittedPackets',
audioRecvNackCountSent = 'audioRecvNackCountSent',
audioRecvLevel = 'audioRecvLevel',
Expand All @@ -188,7 +190,9 @@ export enum RtcStatsMetricNames {
videoRecvJitter = 'videoRecvJitter',
videoRecvRoundTripTime = 'videoRecvRoundTripTime',
videoRecvPackets = 'videoRecvPackets',
videoRecvPacketsLost = 'videoRecvPacketsLost',
videoRecvLostPackets = 'videoRecvLostPackets',
videoRecvPacketsLost = 'videoRecvPacketsLost', // TODO: remove this.
videoRecvPacketsLossRate = 'videoRecvPacketsLossRate',
videoRecvRetransmittedPackets = 'videoRecvRetransmittedPackets',
videoRecvNackCountSent = 'videoRecvNackCountSent',
videoRecvWidth = 'videoRecvWidth',
Expand All @@ -208,7 +212,9 @@ export enum RtcStatsMetricNames {
screenRecvJitter = 'screenRecvJitter',
screenRecvRoundTripTime = 'screenRecvRoundTripTime',
screenRecvPackets = 'screenRecvPackets',
screenRecvPacketsLost = 'screenRecvPacketsLost',
screenRecvLostPackets = 'screenRecvLostPackets',
screenRecvPacketsLost = 'screenRecvPacketsLost', // TODO: remove this.
screenRecvPacketsLossRate = 'screenRecvPacketsLossRate',
screenRecvRetransmittedPackets = 'screenRecvRetransmittedPackets',
screenRecvNackCountSent = 'screenRecvNackCountSent',
screenRecvWidth = 'screenRecvWidth',
Expand Down Expand Up @@ -370,12 +376,25 @@ export function updateRtcStats(
key,
inboundRtp.retransmittedPacketsReceived,
)
// TODO: remove this.
setStats(
stats,
(prefix + 'RecvPacketsLost') as RtcStatsMetricNames,
key,
inboundRtp.packetsLossRate,
)
setStats(
stats,
(prefix + 'RecvPacketsLossRate') as RtcStatsMetricNames,
key,
inboundRtp.packetsLossRate,
)
setStats(
stats,
(prefix + 'RecvLostPackets') as RtcStatsMetricNames,
key,
inboundRtp.packetsLost,
)
setStats(
stats,
(prefix + 'RecvNackCountSent') as RtcStatsMetricNames,
Expand Down

0 comments on commit 96c8eb0

Please sign in to comment.