getNetworkStats()
getNetworkStats()
Returns the latest stats representing the current network, calculated from the WebRTC stats. These statistics are updated approximately once every two seconds. You can poll the getNetworkStats()
method to continually read the current network performance.
Return type
Returns a Promise that resolves to an object with a set of the latest
calculated stats, some overall call stats, and some high level assessments of the current overall network health.
latest
: a collection of statistics from the most recent reporting interval, which occurs approximately once every two seconds:timestamp
: a unix timestamp (seconds since the epoch), set to when thelatest
was calculatedrecvBitsPerSecond
: total data received in the reporting interval from video and/or audio in bits per secondsendBitsPerSecond
: total data sent in the reporting interval from video and/or audio in bits per secondnetworkRoundTripTime
: average latest round trip time reported from all connectionsaudioRecvBitsPerSecond
: total playload data from audio received in the reporting interval in bits per secondaudioRecvPacketLoss
: estimated percentage of packets lost from incoming audio over the reporting intervalaudioSendBitsPerSecond
: total playload data from audio sent in the reporting interval in bits per secondaudioSendPacketLoss
: estimated percentage of packets lost from the audio being sent over the reporting intervalavailableOutgoingBitrate
: average latest available outgoing bitrate reported from all connectionsvideoRecvBitsPerSecond
: total playload data from video received in the reporting interval in bits per secondvideoRecvPacketLoss
: estimated percentage of packets lost from incoming video over the reporting intervalvideoSendBitsPerSecond
: total playload data from video sent in the reporting interval in bits per secondvideoSendPacketLoss
: estimated percentage of packets lost from the video being sent over the reporting intervaltotalSendPacketLoss
: estimated overall percentage of packets lost from the audio and video being sent over the reporting intervaltotalRecvPacketLoss
: estimated overall percentage of packets lost from the received audio and video over the reporting intervalvideoRecvJitter
: average jitter across inbound video streams over the reporting intervalvideoSendJitter
: average jitter across outbound video streams over the reporting intervalaudioRecvJitter
: average jitter across inbound audio streams over the reporting intervalaudioSendJitter
: average jitter across outbound audio streams over the reporting interval
averageNetworkRoundTripTime
: average round trip time over the course of the call.worstAudioRecvPacketLoss
: highestaudioRecvPacketLoss
number seen over a reporting interval during the callworstAudioSendPacketLoss
: highestaudioSendPacketLoss
number seen over a reporting interval during the callworstVideoRecvPacketLoss
: highestvideoRecvPacketLoss
number seen over a reporting interval during the callworstVideoSendPacketLoss
: highestvideoSendPacketLoss
number seen over a reporting interval during the callworstVideoRecvJitter
: highestvideoRecvJitter
value seen over a reporting interval during the callworstVideoSendJitter
: highestvideoSendJitter
value seen over a reporting interval during the callworstAudioRecvJitter
: highestaudioRecvJitter
value seen over a reporting interval during the callworstAudioSendJitter
: highestaudioSendJitter
value seen over a reporting interval during the callthreshold
:'good'
|'low'
|'very-low'
, an assessment of the current network quality. The threshold value is calculated from network stats averaged over an approximately 30-second rolling window.quality
: a subjective calculation of the current network quality on a scale of 1-100, suitable for display in a user interface.
Starting in 0.47.0: If, for a given two second period, a value can not be determined, it will be set to null
. This most commonly occurs for packetLoss
calculations due to the values it relies upon being missing or stale, or media not being transmitted. For instance, if you join a call with audio and video off, your bitrates will be 0 and packetLoss
will be null
because it is unknown.
Also new starting in 0.47.0 is the inclusion of audio send/recv bitrates and packet loss.