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 the latest was calculated
    • recvBitsPerSecond: total data received in the reporting interval from video and/or audio in bits per second
    • sendBitsPerSecond: total data sent in the reporting interval from video and/or audio in bits per second
    • networkRoundTripTime: average latest round trip time reported from all connections
    • audioRecvBitsPerSecond: total playload data from audio received in the reporting interval in bits per second
    • audioRecvPacketLoss: estimated percentage of packets lost from incoming audio over the reporting interval
    • audioSendBitsPerSecond: total playload data from audio sent in the reporting interval in bits per second
    • audioSendPacketLoss: estimated percentage of packets lost from the audio being sent over the reporting interval
    • availableOutgoingBitrate: average latest available outgoing bitrate reported from all connections
    • videoRecvBitsPerSecond: total playload data from video received in the reporting interval in bits per second
    • videoRecvPacketLoss: estimated percentage of packets lost from incoming video over the reporting interval
    • videoSendBitsPerSecond: total playload data from video sent in the reporting interval in bits per second
    • videoSendPacketLoss: estimated percentage of packets lost from the video being sent over the reporting interval
    • totalSendPacketLoss: estimated overall percentage of packets lost from the audio and video being sent over the reporting interval
    • totalRecvPacketLoss: estimated overall percentage of packets lost from the received audio and video over the reporting interval
    • videoRecvJitter: average jitter across inbound video streams over the reporting interval
    • videoSendJitter: average jitter across outbound video streams over the reporting interval
    • audioRecvJitter: average jitter across inbound audio streams over the reporting interval
    • audioSendJitter: average jitter across outbound audio streams over the reporting interval
  • averageNetworkRoundTripTime: average round trip time over the course of the call.
  • worstAudioRecvPacketLoss: highest audioRecvPacketLoss number seen over a reporting interval during the call
  • worstAudioSendPacketLoss: highest audioSendPacketLoss number seen over a reporting interval during the call
  • worstVideoRecvPacketLoss: highest videoRecvPacketLoss number seen over a reporting interval during the call
  • worstVideoSendPacketLoss: highest videoSendPacketLoss number seen over a reporting interval during the call
  • worstVideoRecvJitter: highest videoRecvJitter value seen over a reporting interval during the call
  • worstVideoSendJitter: highest videoSendJitter value seen over a reporting interval during the call
  • worstAudioRecvJitter: highest audioRecvJitter value seen over a reporting interval during the call
  • worstAudioSendJitter: highest audioSendJitter value seen over a reporting interval during the call
  • threshold: '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.

Sample response