ClientSample reference
ClientSample is the object a client-side monitor produces and an observer consumes. It is the
contract between client-monitor-js and
observer-js, and the thing you store if you build your own pipeline.
Schema version 3.7.0
This page is generated from the 3.7.0 Avro sources. Fields added since 3.0.0 are marked inline.
No field has ever been removed in the 3.x line; what changed since 3.3.0 is the type of the
four payload fields and of scoreReasons. See the version history for
what changed and when.
Shape at a glance
ClientSample
├─ timestamp, callId, clientId, score, scoreReasons, attachments
├─ peerConnections[] (PeerConnectionSample)
│ ├─ inboundTracks[] outboundTracks[]
│ ├─ inboundRtps[] outboundRtps[]
│ ├─ remoteInboundRtps[] remoteOutboundRtps[]
│ ├─ mediaSources[] mediaPlayouts[]
│ ├─ codecs[] dataChannels[]
│ ├─ iceTransports[] iceCandidates[]
│ ├─ iceCandidatePairs[] peerConnectionTransports[]
│ └─ certificates[]
├─ clientEvents[] (ClientEvent)
├─ clientIssues[] (ClientIssue)
├─ clientMetaItems[] (ClientMetaData)
└─ extensionStats[] (ExtensionStat)Three conventions run through the whole schema:
timestamp+id— every stats record carries the collection time and the identifier the browser assigned, so records can be correlated across samples.attachments— every record has a free-form slot for your own data. This is how a track becomes “Alice’s screen share” rather than an opaque SSRC.score+scoreReasons— clients, peer connections and tracks can carry a computed 0–5 quality score with a machine-readable explanation.
Top level
ClientSample
The root object. One ClientSample is a snapshot of one participant at one point in time.
| Field | Type | Description |
|---|---|---|
timestamp | number | The timestamp the sample is created in GMT |
callId | stringoptional | the unique identifier of the call or session |
clientId | stringoptional | Unique id of the client providing samples. |
attachments | Record<string, unknown>optional | Additional information attached to this sample (e.g.: roomId, userId, displayName, etc…) |
score | numberoptional | Calculated score for client (details should be added to scoreReasons) |
scoreReasons | Record<string, number>optional | Reasons for the score calculation, mapping each reason to how much it contributed changed in 3.6.0 |
peerConnections | PeerConnectionSample[]optional | Samples taken PeerConnections |
clientEvents | ClientEvent[]optional | A list of client events. |
clientIssues | ClientIssue[]optional | A list of client issues. |
clientMetaItems | ClientMetaData[]optional | A list of additional client events. |
extensionStats | ExtensionStat[]optional | The WebRTC app provided custom stats payload |
PeerConnectionSample
Everything observed on a single RTCPeerConnection during the sampling interval.
| Field | Type | Description |
|---|---|---|
peerConnectionId | string | Unique identifier of the stats object. |
attachments | Record<string, unknown>optional | Additional information attached to this sample |
score | numberoptional | Calculated score for peer connection (details should be added to scoreReasons) |
scoreReasons | Record<string, number>optional | Reasons for the score calculation, mapping each reason to how much it contributed changed in 3.6.0 |
inboundTracks | InboundTrackSample[]optional | Inbound Track Stats items |
outboundTracks | OutboundTrackSample[]optional | Outbound Track Stats items |
codecs | CodecStats[]optional | Codec items |
inboundRtps | InboundRtpStats[]optional | Inbound RTP Stats |
remoteInboundRtps | RemoteInboundRtpStats[]optional | Remote Inbound RTP Stats |
outboundRtps | OutboundRtpStats[]optional | Outbound RTP Stats |
remoteOutboundRtps | RemoteOutboundRtpStats[]optional | Remote Outbound RTP Stats |
mediaSources | MediaSourceStats[]optional | Audio Source Stats |
mediaPlayouts | MediaPlayoutStats[]optional | Media Playout Stats |
peerConnectionTransports | PeerConnectionTransportStats[]optional | PeerConnection Transport Stats |
dataChannels | DataChannelStats[]optional | Data Channels Stats |
iceTransports | IceTransportStats[]optional | ICE Transport Stats |
iceCandidates | IceCandidateStats[]optional | ICE Candidate Stats |
iceCandidatePairs | IceCandidatePairStats[]optional | ICE Candidate Pair Stats |
certificates | CertificateStats[]optional | Certificate Stats |
Tracks
InboundTrackSample
A received media track, scored by the client.
| Field | Type | Description |
|---|---|---|
timestamp | number | The timestamp when the stats were generated. |
id | string | The unique identifier for the stats object. |
kind | string | Kind of the media (e.g., ‘audio’ or ‘video’). |
score | numberoptional | Calculated score for track (details should be added to scoreReasons) |
scoreReasons | Record<string, number>optional | Reasons for the score calculation, mapping each reason to how much it contributed changed in 3.6.0 |
attachments | Record<string, unknown>optional | Additional information attached to this stats |
OutboundTrackSample
A sent media track, scored by the client.
| Field | Type | Description |
|---|---|---|
timestamp | number | The timestamp when the stats were generated. |
id | string | The unique identifier for the stats object. |
kind | string | Kind of the media (e.g., ‘audio’ or ‘video’). |
score | numberoptional | Calculated score for track (details should be added to scoreReasons) |
scoreReasons | Record<string, number>optional | Reasons for the score calculation, mapping each reason to how much it contributed changed in 3.6.0 |
attachments | Record<string, unknown>optional | Additional information attached to this stats |
RTP statistics
InboundRtpStats
Receiving side of one RTP stream (inbound-rtp).
| Field | Type | Description |
|---|---|---|
timestamp | number | The time the stats were collected, in high-resolution time. |
id | string | Unique identifier of the stats object. |
ssrc | number | Synchronization source identifier of the RTP stream. |
kind | string | Kind of the media (e.g., ‘audio’ or ‘video’). |
trackIdentifier | string | Identifier for the media track associated with the RTP stream. |
transportId | stringoptional | ID of the transport associated with the RTP stream. |
codecId | stringoptional | ID of the codec used for the RTP stream. |
packetsReceived | numberoptional | Number of packets received on the RTP stream. |
packetsReceivedWithEct1 | numberoptional | Total number of RTP packets received for this SSRC marked with the ECT(1) marking. new in 3.2.0 |
packetsReceivedWithCe | numberoptional | Total number of RTP packets received for this SSRC marked with the CE marking. new in 3.2.0 |
packetsReportedAsLost | numberoptional | Total number of RTP packets for which an RFC8888 report has been sent with a zero R bit. new in 3.2.0 |
packetsReportedAsLostButRecovered | numberoptional | Total number of RTP packets reported as lost but later recovered in a subsequent RFC8888 report. new in 3.2.0 |
packetsLost | numberoptional | Number of packets lost on the RTP stream. |
jitter | numberoptional | Jitter of the RTP stream in seconds. |
mid | stringoptional | The media stream identification tag from the SDP media section. |
remoteId | stringoptional | Remote stats object ID associated with the RTP stream. |
framesDecoded | numberoptional | Number of frames decoded. |
keyFramesDecoded | numberoptional | Number of keyframes decoded. |
framesRendered | numberoptional | Number of frames rendered. |
framesDropped | numberoptional | Number of frames dropped. |
frameWidth | numberoptional | Width of the decoded video frames. |
frameHeight | numberoptional | Height of the decoded video frames. |
framesPerSecond | numberoptional | Frame rate in frames per second. |
qpSum | numberoptional | Sum of the Quantization Parameter values for decoded frames. |
totalDecodeTime | numberoptional | Total time spent decoding in seconds. |
totalInterFrameDelay | numberoptional | Sum of inter-frame delays in seconds. |
totalSquaredInterFrameDelay | numberoptional | Sum of squared inter-frame delays in seconds. |
pauseCount | numberoptional | Number of times playback was paused. |
totalPausesDuration | numberoptional | Total duration of pauses in seconds. |
freezeCount | numberoptional | Number of times playback was frozen. |
totalFreezesDuration | numberoptional | Total duration of freezes in seconds. |
lastPacketReceivedTimestamp | numberoptional | Timestamp of the last packet received. |
headerBytesReceived | numberoptional | Total header bytes received. |
packetsDiscarded | numberoptional | Total packets discarded. |
fecBytesReceived | numberoptional | Total bytes received from FEC. |
fecPacketsReceived | numberoptional | Total packets received from FEC. |
fecPacketsDiscarded | numberoptional | Total FEC packets discarded. |
bytesReceived | numberoptional | Total bytes received on the RTP stream. |
nackCount | numberoptional | Number of NACKs received. |
firCount | numberoptional | Number of Full Intra Requests received. |
pliCount | numberoptional | Number of Picture Loss Indications received. |
totalProcessingDelay | numberoptional | Total processing delay in seconds. |
estimatedPlayoutTimestamp | numberoptional | Estimated timestamp of playout. |
jitterBufferDelay | numberoptional | Total jitter buffer delay in seconds. |
jitterBufferTargetDelay | numberoptional | Target delay for the jitter buffer in seconds. |
jitterBufferEmittedCount | numberoptional | Number of packets emitted from the jitter buffer. |
jitterBufferMinimumDelay | numberoptional | Minimum delay of the jitter buffer in seconds. |
totalSamplesReceived | numberoptional | Total audio samples received. |
concealedSamples | numberoptional | Number of concealed audio samples. |
silentConcealedSamples | numberoptional | Number of silent audio samples concealed. |
concealmentEvents | numberoptional | Number of audio concealment events. |
insertedSamplesForDeceleration | numberoptional | Number of audio samples inserted for deceleration. |
removedSamplesForAcceleration | numberoptional | Number of audio samples removed for acceleration. |
audioLevel | numberoptional | Audio level in the range [0.0, 1.0]. |
totalAudioEnergy | numberoptional | Total audio energy in the stream. |
totalSamplesDuration | numberoptional | Total duration of all received audio samples in seconds. |
framesReceived | numberoptional | Total number of frames received. |
decoderImplementation | stringoptional | Decoder implementation used for decoding frames. |
playoutId | stringoptional | Playout identifier for the RTP stream. |
powerEfficientDecoder | booleanoptional | Indicates if the decoder is power-efficient. |
framesAssembledFromMultiplePackets | numberoptional | Number of frames assembled from multiple packets. |
totalAssemblyTime | numberoptional | Total assembly time for frames in seconds. |
retransmittedPacketsReceived | numberoptional | Number of retransmitted packets received. |
retransmittedBytesReceived | numberoptional | Number of retransmitted bytes received. |
rtxSsrc | numberoptional | SSRC of the retransmission stream. |
fecSsrc | numberoptional | SSRC of the FEC stream. |
totalCorruptionProbability | numberoptional | Total corruption probability of packets. |
totalSquaredCorruptionProbability | numberoptional | Total squared corruption probability of packets. |
corruptionMeasurements | numberoptional | Number of corruption measurements. |
attachments | Record<string, unknown>optional | Additional information attached to this stats |
OutboundRtpStats
Sending side of one RTP stream (outbound-rtp).
| Field | Type | Description |
|---|---|---|
timestamp | number | The timestamp for this stats object in DOMHighResTimeStamp format. |
id | string | The unique identifier for this stats object. |
ssrc | number | The SSRC identifier of the RTP stream. |
kind | string | The type of media (‘audio’ or ‘video’). |
transportId | stringoptional | The ID of the transport used for this stream. |
codecId | stringoptional | The ID of the codec used for this stream. |
packetsSent | numberoptional | The total number of packets sent on this stream. |
bytesSent | numberoptional | The total number of bytes sent on this stream. |
mid | stringoptional | The media ID associated with this RTP stream. |
mediaSourceId | stringoptional | The ID of the media source associated with this stream. |
remoteId | stringoptional | The ID of the remote object corresponding to this stream. |
rid | stringoptional | The RID value of the RTP stream. |
encodingIndex | numberoptional | Index of the encoding in the encoding array. new in 3.2.0 |
headerBytesSent | numberoptional | The total number of header bytes sent on this stream. |
retransmittedPacketsSent | numberoptional | The number of retransmitted packets sent on this stream. |
retransmittedBytesSent | numberoptional | The number of retransmitted bytes sent on this stream. |
rtxSsrc | numberoptional | The SSRC for the RTX stream, if applicable. |
targetBitrate | numberoptional | The target bitrate for this RTP stream in bits per second. |
totalEncodedBytesTarget | numberoptional | The total target encoded bytes for this stream. |
frameWidth | numberoptional | The width of the frames sent in pixels. |
frameHeight | numberoptional | The height of the frames sent in pixels. |
framesPerSecond | numberoptional | The number of frames sent per second. |
framesSent | numberoptional | The total number of frames sent on this stream. |
hugeFramesSent | numberoptional | The total number of huge frames sent on this stream. |
framesEncoded | numberoptional | The total number of frames encoded on this stream. |
keyFramesEncoded | numberoptional | The total number of key frames encoded on this stream. |
qpSum | numberoptional | The sum of QP values for all frames encoded on this stream. |
psnrSum | PsnrSumoptional | Cumulative PSNR measurements for Y, U, V components. new in 3.2.0 |
psnrMeasurements | numberoptional | Total number of PSNR measurements collected. new in 3.2.0 |
totalEncodeTime | numberoptional | The total time spent encoding frames on this stream in seconds. |
totalPacketSendDelay | numberoptional | The total delay for packets sent on this stream in seconds. |
qualityLimitationReason | stringoptional | The reason for any quality limitation on this stream (e.g., ‘cpu’, ‘bandwidth’, ‘other’). |
qualityLimitationDurations | QualityLimitationDurationsoptional | The duration of quality limitation reasons categorized by type. new in 3.2.0 |
qualityLimitationResolutionChanges | numberoptional | The number of resolution changes due to quality limitations. |
nackCount | numberoptional | The total number of NACK packets sent on this stream. |
firCount | numberoptional | The total number of FIR packets sent on this stream. |
pliCount | numberoptional | The total number of PLI packets sent on this stream. |
encoderImplementation | stringoptional | The implementation of the encoder used for this stream. |
powerEfficientEncoder | booleanoptional | Indicates whether the encoder is power-efficient. |
active | booleanoptional | Indicates whether this stream is actively sending data. |
scalabilityMode | stringoptional | The scalability mode of the encoder used for this stream. |
packetsSentWithEct1 | numberoptional | Number of packets sent with ECT(1) congestion marking. new in 3.2.0 |
attachments | Record<string, unknown>optional | Additional information attached to this stats. |
RemoteInboundRtpStats
The remote peer’s view of what we send (remote-inbound-rtp, from RTCP Receiver Reports).
| Field | Type | Description |
|---|---|---|
timestamp | number | The timestamp for this stats object in DOMHighResTimeStamp format. |
id | string | The unique identifier for this stats object. |
ssrc | number | The SSRC identifier of the RTP stream. |
kind | string | The type of media (‘audio’ or ‘video’). |
transportId | stringoptional | The ID of the transport used for this stream. |
codecId | stringoptional | The ID of the codec used for this stream. |
packetsReceived | numberoptional | The total number of packets received on this stream. |
packetsReceivedWithEct1 | numberoptional | Total number of RTP packets received for this SSRC marked with the ECT(1) marking. new in 3.2.0 |
packetsReceivedWithCe | numberoptional | Total number of RTP packets received for this SSRC marked with the CE marking. new in 3.2.0 |
packetsReportedAsLost | numberoptional | Total number of RTP packets for which an RFC8888 report has been sent with a zero R bit. new in 3.2.0 |
packetsReportedAsLostButRecovered | numberoptional | Total number of RTP packets reported as lost but later recovered in a subsequent RFC8888 report. new in 3.2.0 |
packetsLost | numberoptional | The total number of packets lost on this stream. |
jitter | numberoptional | The jitter value for this stream in seconds. |
localId | stringoptional | The ID of the local object corresponding to this remote stream. |
roundTripTime | numberoptional | The most recent RTT measurement for this stream in seconds. |
totalRoundTripTime | numberoptional | The cumulative RTT for all packets on this stream in seconds. |
fractionLost | numberoptional | The fraction of packets lost on this stream, calculated over a time interval. |
roundTripTimeMeasurements | numberoptional | The total number of RTT measurements for this stream. |
packetsWithBleachedEct1Marking | numberoptional | Number of packets with ECT(1) marking that were bleached by a middlebox. new in 3.2.0 |
attachments | Record<string, unknown>optional | Additional information attached to this stats |
RemoteOutboundRtpStats
The remote peer’s view of what it sends us (remote-outbound-rtp, from RTCP Sender Reports).
| Field | Type | Description |
|---|---|---|
timestamp | number | The timestamp for this stats object in DOMHighResTimeStamp format. |
id | string | The unique identifier for this stats object. |
ssrc | number | The SSRC identifier of the RTP stream. |
kind | string | The type of media (‘audio’ or ‘video’). |
transportId | stringoptional | The ID of the transport used for this stream. |
codecId | stringoptional | The ID of the codec used for this stream. |
packetsSent | numberoptional | The total number of packets sent on this stream. |
bytesSent | numberoptional | The total number of bytes sent on this stream. |
localId | stringoptional | The ID of the local object corresponding to this stream. |
remoteTimestamp | numberoptional | The remote timestamp for this stats object in DOMHighResTimeStamp format. |
reportsSent | numberoptional | The total number of reports sent on this stream. |
roundTripTime | numberoptional | The current estimated round-trip time for this stream in seconds. |
totalRoundTripTime | numberoptional | The total round-trip time for this stream in seconds. |
roundTripTimeMeasurements | numberoptional | The total number of round-trip time measurements for this stream. |
attachments | Record<string, unknown>optional | Additional information attached to this stats |
QualityLimitationDurations
Cumulative seconds spent in each quality-limitation state, nested inside OutboundRtpStats.
| Field | Type | Description |
|---|---|---|
none | number | Duration of no quality limitation in seconds. |
cpu | number | Duration of CPU-based quality limitation in seconds. |
bandwidth | number | Duration of bandwidth-based quality limitation in seconds. |
other | number | Duration of other quality limitation reasons in seconds. |
PsnrSum
Cumulative per-plane PSNR, nested inside OutboundRtpStats.
| Field | Type | Description |
|---|---|---|
y | number | PSNR value for the Y (luminance) component. |
u | number | PSNR value for the U (chrominance) component. |
v | number | PSNR value for the V (chrominance) component. |
Media
MediaSourceStats
A local capture source (media-source) feeding one or more outbound RTP streams.
| Field | Type | Description |
|---|---|---|
timestamp | number | The timestamp of the stat. |
id | string | A unique identifier for the stat. |
kind | string | The type of media (‘audio’ or ‘video’). |
trackIdentifier | stringoptional | The identifier of the media track. |
audioLevel | numberoptional | The current audio level. |
totalAudioEnergy | numberoptional | The total audio energy. |
totalSamplesDuration | numberoptional | The total duration of audio samples. |
echoReturnLoss | numberoptional | The echo return loss. |
echoReturnLossEnhancement | numberoptional | The enhancement of echo return loss. |
width | numberoptional | The width of the video. |
height | numberoptional | The height of the video. |
frames | numberoptional | The total number of frames. |
framesPerSecond | numberoptional | The frames per second of the video. |
attachments | Record<string, unknown>optional | Additional information attached to this stats |
MediaPlayoutStats
Audio playout path (media-playout) — where synthesized/stretched samples show up.
| Field | Type | Description |
|---|---|---|
timestamp | number | The timestamp of the stat. |
id | string | A unique identifier for the stat. |
kind | string | The kind of media (audio/video). |
synthesizedSamplesDuration | numberoptional | The duration of synthesized audio samples. |
synthesizedSamplesEvents | numberoptional | The number of synthesized audio samples events. |
totalSamplesDuration | numberoptional | The total duration of all audio samples. |
totalPlayoutDelay | numberoptional | The total delay experienced during audio playout. |
totalSamplesCount | numberoptional | The total count of audio samples. |
attachments | Record<string, unknown>optional | Additional information attached to this stats |
CodecStats
A negotiated codec (codec).
| Field | Type | Description |
|---|---|---|
timestamp | number | The timestamp when the stats were generated. |
id | string | The unique identifier for the stats object. |
mimeType | string | The MIME type of the codec. |
payloadType | numberoptional | The payload type of the codec. |
transportId | stringoptional | The identifier of the transport associated with the codec. |
clockRate | numberoptional | The clock rate of the codec in Hz. |
channels | numberoptional | The number of audio channels for the codec, if applicable. |
sdpFmtpLine | stringoptional | The SDP format-specific parameters line for the codec. |
attachments | Record<string, unknown>optional | Additional information attached to this stats |
Transport & connectivity
PeerConnectionTransportStats
Peer-connection level data channel counters (peer-connection).
| Field | Type | Description |
|---|---|---|
timestamp | number | The timestamp of the stat. |
id | string | A unique identifier for the stat. |
dataChannelsOpened | numberoptional | The number of data channels opened. |
dataChannelsClosed | numberoptional | The number of data channels closed. |
attachments | Record<string, unknown>optional | Additional information attached to this stats |
DataChannelStats
One RTCDataChannel (data-channel).
| Field | Type | Description |
|---|---|---|
timestamp | number | The timestamp of the stat. |
id | string | A unique identifier for the stat. |
label | stringoptional | The label of the data channel. |
protocol | stringoptional | The protocol of the data channel. |
dataChannelIdentifier | numberoptional | The identifier for the data channel. |
state | stringoptional | The state of the data channel (e.g., ‘open’, ‘closed’). |
messagesSent | numberoptional | The number of messages sent on the data channel. |
bytesSent | numberoptional | The number of bytes sent on the data channel. |
messagesReceived | numberoptional | The number of messages received on the data channel. |
bytesReceived | numberoptional | The number of bytes received on the data channel. |
attachments | Record<string, unknown>optional | Additional information attached to this stats |
IceTransportStats
ICE/DTLS transport (transport).
| Field | Type | Description |
|---|---|---|
timestamp | number | The timestamp of the stat. |
id | string | A unique identifier for the stat. |
packetsSent | numberoptional | The number of packets sent. |
packetsReceived | numberoptional | The number of packets received. |
bytesSent | numberoptional | The number of bytes sent. |
bytesReceived | numberoptional | The number of bytes received. |
iceRole | stringoptional | The ICE role (e.g., ‘controlling’, ‘controlled’). |
iceLocalUsernameFragment | stringoptional | The local username fragment for ICE. |
dtlsState | stringoptional | The DTLS transport state (e.g., ’new’, ‘connecting’, ‘connected’). |
iceState | stringoptional | The ICE transport state (e.g., ’new’, ‘checking’, ‘connected’). |
selectedCandidatePairId | stringoptional | The ID of the selected ICE candidate pair. |
localCertificateId | stringoptional | The ID of the local certificate. |
remoteCertificateId | stringoptional | The ID of the remote certificate. |
tlsVersion | stringoptional | The TLS version used for encryption. |
dtlsCipher | stringoptional | The DTLS cipher suite used. |
dtlsRole | stringoptional | The role in the DTLS handshake (e.g., ‘client’, ‘server’). |
srtpCipher | stringoptional | The SRTP cipher used for encryption. |
selectedCandidatePairChanges | numberoptional | The number of changes to the selected ICE candidate pair. |
ccfbMessagesSent | numberoptional | Number of congestion control feedback (CCFB) messages sent on this transport. new in 3.2.0 |
ccfbMessagesReceived | numberoptional | Number of congestion control feedback (CCFB) messages received on this transport. new in 3.2.0 |
attachments | Record<string, unknown>optional | Additional information attached to this stats. |
IceCandidateStats
One local or remote ICE candidate (local-candidate / remote-candidate).
| Field | Type | Description |
|---|---|---|
timestamp | number | The timestamp of the stat. |
id | string | A unique identifier for the stat. |
transportId | stringoptional | The transport ID associated with the ICE candidate. |
address | stringoptional | The IP address of the ICE candidate. |
port | numberoptional | The port number of the ICE candidate. |
protocol | stringoptional | The transport protocol used by the candidate (e.g., ‘udp’, ’tcp’). |
candidateType | stringoptional | The type of the ICE candidate (e.g., ‘host’, ‘srflx’, ‘relay’). |
priority | numberoptional | The priority of the ICE candidate. |
url | stringoptional | The URL of the ICE candidate. |
relayProtocol | stringoptional | The protocol used for the relay (e.g., ’tcp’, ‘udp’). |
foundation | stringoptional | A string representing the foundation for the ICE candidate. |
relatedAddress | stringoptional | The related address for the ICE candidate (if any). |
relatedPort | numberoptional | The related port for the ICE candidate (if any). |
usernameFragment | stringoptional | The username fragment for the ICE candidate. |
tcpType | stringoptional | The TCP type of the ICE candidate (e.g., ‘active’, ‘passive’). |
attachments | Record<string, unknown>optional | Additional information attached to this stats |
IceCandidatePairStats
One ICE candidate pair (candidate-pair) — where RTT and bandwidth estimates live.
| Field | Type | Description |
|---|---|---|
id | string | The unique identifier for this RTCStats object. |
timestamp | number | The timestamp of when the stats were recorded, in milliseconds. |
transportId | stringoptional | The transport id of the connection this candidate pair belongs to. |
localCandidateId | stringoptional | The ID of the local ICE candidate in this pair. |
remoteCandidateId | stringoptional | The ID of the remote ICE candidate in this pair. |
state | "new" | "frozen" | "in-progress" | "waiting" | "failed" | "succeeded" | "cancelled" | "inprogress"optional | The checklist state of this candidate pair. Values follow the W3C RTCStatsIceCandidatePairState enum (frozen, waiting, in-progress, failed, succeeded). Two further values are accepted for backward compatibility and are not part of the current spec: new (never standardised) and cancelled (removed from the spec after 2016). |
nominated | booleanoptional | Whether this candidate pair has been nominated. |
packetsSent | numberoptional | The number of packets sent using this candidate pair. |
packetsReceived | numberoptional | The number of packets received using this candidate pair. |
bytesSent | numberoptional | The total number of bytes sent using this candidate pair. |
bytesReceived | numberoptional | The total number of bytes received using this candidate pair. |
lastPacketSentTimestamp | numberoptional | The timestamp of the last packet sent using this candidate pair. |
lastPacketReceivedTimestamp | numberoptional | The timestamp of the last packet received using this candidate pair. |
totalRoundTripTime | numberoptional | The total round trip time (RTT) for this candidate pair in seconds. |
currentRoundTripTime | numberoptional | The current round trip time (RTT) for this candidate pair in seconds. |
availableOutgoingBitrate | numberoptional | The available outgoing bitrate (in bits per second) for this candidate pair. |
availableIncomingBitrate | numberoptional | The available incoming bitrate (in bits per second) for this candidate pair. |
requestsReceived | numberoptional | The number of ICE connection requests received by this candidate pair. |
requestsSent | numberoptional | The number of ICE connection requests sent by this candidate pair. |
responsesReceived | numberoptional | The number of ICE connection responses received by this candidate pair. |
responsesSent | numberoptional | The number of ICE connection responses sent by this candidate pair. |
consentRequestsSent | numberoptional | The number of ICE connection consent requests sent by this candidate pair. |
packetsDiscardedOnSend | numberoptional | The number of packets discarded while attempting to send via this candidate pair. |
bytesDiscardedOnSend | numberoptional | The total number of bytes discarded while attempting to send via this candidate pair. |
attachments | Record<string, unknown>optional | Additional information attached to this stats |
CertificateStats
A DTLS certificate (certificate).
| Field | Type | Description |
|---|---|---|
timestamp | number | The timestamp of the stat. |
id | string | A unique identifier for the stat. |
fingerprint | stringoptional | The fingerprint of the certificate. |
fingerprintAlgorithm | stringoptional | The algorithm used for the fingerprint (e.g., ‘SHA-256’). |
base64Certificate | stringoptional | The certificate encoded in base64 format. |
issuerCertificateId | stringoptional | The certificate ID of the issuer. |
attachments | Record<string, unknown>optional | Additional information attached to this stats |
Application-level payloads
ClientEvent
A discrete thing that happened on the client (joined, track added, ICE state change, …).
| Field | Type | Description |
|---|---|---|
type | string | The name of the event used as an identifier (e.g., MEDIA_TRACK_MUTED, USER_REJOINED, etc.). |
payload | Record<string, unknown>optional | Free-form JSON associated with the event. Was a pre-serialised string before 3.5.0, a flat record of primitives in 3.5.0–3.6.0 changed in 3.7.0 |
timestamp | numberoptional | The timestamp in epoch format when the event was generated. |
ClientIssue
A problem state reported by the client, with an optional key tying a raise to its resolution.
| Field | Type | Description |
|---|---|---|
type | string | The name of the issue |
key | stringoptional | Identifier of the related issue or resolution when it is provided. new in 3.3.0 |
payload | Record<string, unknown>optional | Free-form JSON associated with the issue changed in 3.7.0 |
timestamp | numberoptional | The timestamp in epoch format when the event was generated. |
ClientMetaData
Environment and device information (browser, OS, media devices, SDP, …).
| Field | Type | Description |
|---|---|---|
type | string | The name of the event used as an identifier (e.g., MEDIA_TRACK_MUTED, USER_REJOINED, etc.). |
payload | Record<string, unknown>optional | Free-form JSON associated with the meta item changed in 3.7.0 |
peerConnectionId | stringoptional | The unique identifier of the peer connection for which the event was generated. |
trackId | stringoptional | The identifier of the media track related to the event, if applicable. |
ssrc | numberoptional | The SSRC (Synchronization Source) identifier associated with the event, if applicable. |
timestamp | numberoptional | The timestamp in epoch format when the event was generated. |
ExtensionStat
Free-form application statistics carried alongside the WebRTC stats.
| Field | Type | Description |
|---|---|---|
type | string | The type of the extension stats the custom app provides |
payload | Record<string, unknown>optional | Free-form JSON provided by the application changed in 3.7.0 |
Notes on selected fields
payload fields are free-form JSON, and have been through three shapes
ClientEvent.payload, ClientIssue.payload, ClientMetaData.payload and ExtensionStat.payload
are Record<string, unknown> as of 3.7.0, so a payload may nest objects and arrays freely —
structured context such as { device: { os: { name, version } } } no longer has to be flattened
into dotted keys or stringified into one field.
| Generation | Payload shape |
|---|---|
| pre-3.5.0 | A pre-serialised JSON string |
| 3.5.0 – 3.6.0 | A flat record of primitives — Record<string, boolean | string | number> |
| 3.7.0 | Free-form JSON — Record<string, unknown> |
A fleet does not have to move in step. observer-js passes an object through untouched and
parses a string, so an old client and a new one produce the same object downstream.
Reading a payload value now needs narrowing: payload.role was boolean | string | number and
is unknown, so String(payload.role) or a type guard replaces a bare read. Writers need no
change — everything that was valid before still is.
attachments is free-form JSON too
It has been Record<string, unknown> since it stopped being a string, and it is the model the
payload fields caught up with in 3.7.0.
Non-finite numbers are rejected, not silently nulled
Both codecs walk an opaque value before copying it and reject a NaN, an Infinity or a bigint
anywhere inside a payload or attachments, reporting the path that reached it. JSON.stringify
would have turned the first two into null without complaint.
ECN and RFC 8888 counters
packetsReceivedWithEct1, packetsReceivedWithCe, packetsReportedAsLost,
packetsReportedAsLostButRecovered, packetsSentWithEct1 and packetsWithBleachedEct1Marking
support Explicit Congestion Notification and RFC 8888 congestion control feedback. They are only
populated by browsers that implement L4S-style congestion signalling — treat them as optional
everywhere.
IceCandidatePairStats.state
The schema keeps two values that are no longer in the W3C enum, so older clients keep validating:
new (never standardised) and cancelled (removed after
w3c/webrtc-stats#66). The current spec values are
frozen, waiting, in-progress, failed, succeeded.