Skip to content

Commit

Permalink
Added packet counters stats
Browse files Browse the repository at this point in the history
  • Loading branch information
vpalmisano committed Oct 19, 2023
1 parent 4d47f21 commit 451b20a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
2 changes: 2 additions & 0 deletions scripts/peer-connection-stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ async function getPeerConnectionStats(
kind,
packetsLost,
packetsReceived,
retransmittedPacketsReceived,
jitter,
bytesReceived,
headerBytesReceived,
Expand Down Expand Up @@ -363,6 +364,7 @@ async function getPeerConnectionStats(
kind,
packetsLost,
packetsReceived,
retransmittedPacketsReceived,
jitter,
bytesReceived,
headerBytesReceived,
Expand Down
26 changes: 18 additions & 8 deletions src/rtcstats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ export enum RtcStatsMetricNames {
audioRecvBitrates = 'audioRecvBitrates',
audioRecvJitter = 'audioRecvJitter',
audioRecvRoundTripTime = 'audioRecvRoundTripTime',
//'audioRecvPackets',
audioRecvPackets = 'audioRecvPackets',
audioRecvPacketsLost = 'audioRecvPacketsLost',
//'audioRecvPacketsLostCount',
audioRecvRetransmittedPackets = 'audioRecvRetransmittedPackets',
audioRecvNackCountSent = 'audioRecvNackCountSent',
audioRecvLevel = 'audioRecvLevel',
audioRecvConcealedSamples = 'audioRecvConcealedSamples',
Expand All @@ -182,9 +182,9 @@ export enum RtcStatsMetricNames {
videoRecvHeight = 'videoRecvHeight',
videoRecvJitter = 'videoRecvJitter',
videoRecvRoundTripTime = 'videoRecvRoundTripTime',
//'videoRecvPackets',
videoRecvPackets = 'videoRecvPackets',
videoRecvPacketsLost = 'videoRecvPacketsLost',
//'videoRecvPacketsLostCount',
videoRecvRetransmittedPackets = 'videoRecvRetransmittedPackets',
videoRecvNackCountSent = 'videoRecvNackCountSent',
videoRecvWidth = 'videoRecvWidth',
//'videoTotalDecodeTime',
Expand All @@ -202,9 +202,9 @@ export enum RtcStatsMetricNames {
screenRecvHeight = 'screenRecvHeight',
screenRecvJitter = 'screenRecvJitter',
screenRecvRoundTripTime = 'screenRecvRoundTripTime',
//'screenRecvPackets',
screenRecvPackets = 'screenRecvPackets',
screenRecvPacketsLost = 'screenRecvPacketsLost',
//'screenRecvPacketsLostCount',
screenRecvRetransmittedPackets = 'screenRecvRetransmittedPackets',
screenRecvNackCountSent = 'screenRecvNackCountSent',
screenRecvWidth = 'screenRecvWidth',
//'screenTotalDecodeTime',
Expand Down Expand Up @@ -353,14 +353,24 @@ export function updateRtcStats(
key,
inboundRtp.transportRoundTripTime,
)
//setStats(stats, prefix + 'RecvPackets', key, inboundRtp.packetsReceived)
setStats(
stats,
(prefix + 'RecvPackets') as RtcStatsMetricNames,
key,
inboundRtp.packetsReceived,
)
setStats(
stats,
(prefix + 'RecvRetransmittedPackets') as RtcStatsMetricNames,
key,
inboundRtp.retransmittedPacketsReceived,
)
setStats(
stats,
(prefix + 'RecvPacketsLost') as RtcStatsMetricNames,
key,
inboundRtp.packetsLossRate,
)
//setStats(stats, prefix + 'RecvPacketsLostCount', key, inboundRtp.packetsLost)
setStats(
stats,
(prefix + 'RecvNackCountSent') as RtcStatsMetricNames,
Expand Down

0 comments on commit 451b20a

Please sign in to comment.