Call Statistics
There are two sources of statistics you can use to monitor the performance of your calls:
Call.stats
stream that provides real-time webRTC statisticsCallState
properties that contain some of the webRTC statistics processed and more useful for display purposes
Stats stream
If you want to tap in directly into the stream of webRTC stats you can do this with stats
stream inside Call
object. It provides a stream of CallStats
objects for publisher and subscriber connections.
We provide those statistics in three ways for ease of use:
raw
- Raw stats as they come from WebRTC.printable
- Representation of the stats that can be easily printed to the console or as a block of text.stats
- WebRTC stats but in a structured form.
CallState properties
You can also access more processed data with useful information about the call. This data is available in CallState
object. Here are some of the properties that you can use:
publisherStats
and subscriberStats
- objects that contain the following data:
latency
- The time it takes to deliver the data between the server and the app.jitterInMs
- The variation in the delay of receiving packets of data over a network.bitrateKbps
- The rate at which data is transmitted from the app to the server (publisher) or from the server to the app (subscriber).
localStats
- An object that contains the following data:
sfu
- The server to which the device is connected.sdkVersion
- The version of the Stream SDK.webRtcVersion
- The version of WebRTC.
latencyHistory
- Array of latency values for the last 10 seconds.
Example usage
You can check the example of the stats screen in our demo app