8.6 Mandatory To Implement Stats

The stats listed in [WEBRTC-STATS] are intended to cover a wide range of use cases. Not all of them have to be implemented by every WebRTC implementation.

An implementation MUST support generating statistics of the following types when the corresponding objects exist on a RTCPeerConnection, with the fields that are listed when they are valid for that object in addition to the generic fields defined in the RTCStats dictionary:

RTCStatsTypeDictionaryFields
codecRTCCodecStatspayloadType, codecType, mimeType, clockRate, channels, sdpFmtpLine
inbound-rtpRTCRtpStreamStatsssrc, kind, transportId, codecId
RTCReceivedRtpStreamStatspacketsReceived, packetsLost, jitter, packetsDiscarded, framesDropped
RTCInboundRtpStreamStatsreceiverId, remoteId, framesDecoded, nackCount, framesReceived, bytesReceived, totalAudioEnergy, totalSamplesDuration
outbound-rtpRTCRtpStreamStatsssrc, kind, transportId, codecId
RTCSentRtpStreamStatspacketsSent, bytesSent
RTCOutboundRtpStreamStatssenderId, remoteId, framesEncoded, nackCount, framesSent
remote-inbound-rtpRTCRtpStreamStatsssrc, kind, transportId, codecId
RTCReceivedRtpStreamStatspacketsReceived, packetsLost, jitter, packetsDiscarded, framesDropped
RTCRemoteInboundRtpStreamStatslocalId, roundTripTime
remote-outbound-rtpRTCRtpStreamStatsssrc, kind, transportId, codecId
RTCSentRtpStreamStatspacketsSent, bytesSent
RTCRemoteOutboundRtpStreamStatslocalId, remoteTimestamp
media-sourceRTCMediaSourceStatstrackIdentifier, kind
RTCAudioSourceStatstotalAudioEnergy, totalSamplesDuration (for audio tracks attached to senders)
RTCVideoSourceStatswidth, height, framesPerSecond (for video tracks attached to senders)
peer-connectionRTCPeerConnectionStatsdataChannelsOpened, dataChannelsClosed
data-channelRTCDataChannelStatslabel , protocol, dataChannelIdentifier, state, messagesSent, bytesSent, messagesReceived, bytesReceived
senderRTCMediaHandlerStatstrackIdentifier
receiver
transportRTCTransportStatsbytesSent, bytesReceived, selectedCandidatePairId, localCertificateId, remoteCertificateId
candidate-pairRTCIceCandidatePairStatstransportId, localCandidateId, remoteCandidateId, state, nominated, bytesSent, bytesReceived, totalRoundTripTime, currentRoundTripTime
local-candidateRTCIceCandidateStatsaddress, port, protocol, candidateType, url
remote-candidate
certificateRTCCertificateStatsfingerprint, fingerprintAlgorithm, base64Certificate, issuerCertificateId

An implementation MAY support generating any other statistic defined in [WEBRTC-STATS], and MAY generate statistics that are not documented.