You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: How to listen and leverage call statistics
5
+
---
6
+
7
+
There are two sources of statistics you can use to monitor the performance of your calls:
8
+
-`Call.stats` stream that provides real-time webRTC statistics
9
+
-`CallState` properties that contain some of the webRTC statistics processed and more useful for display purposes
10
+
11
+
## Stats stream
12
+
13
+
If you want to tap in directly into the stream of webRTC stats you can do this with `stats` steam inside `Call` object. It provides a stream of [`CallStats`](https://github.com/GetStream/stream-video-flutter/blob/main/packages/stream_video/lib/src/models/call_stats.dart) objects for publisher and subscriber connections.
14
+
We provide those statistics in three ways for ease of use:
15
+
16
+
*`raw` - raw stats as they come from the webRTC
17
+
*`printable` - representation of the stats that can be easily printed to the console or as a block of text
18
+
*`stats` - webRTC stats but in a structured form
19
+
20
+
## CallState properties
21
+
22
+
You can also access more processed data with useful information about the call. This data is available in [`CallState`](https://github.com/GetStream/stream-video-flutter/blob/main/packages/stream_video/lib/src/call_state.dart) object. Here are some of the properties that you can use:
23
+
24
+
`publisherStats` and `subscriberStats` - objects that contain the following data:
25
+
*`latency` - the time it takes to deliver the data between the server and the app
26
+
*`jitterInMs` - the variation in the delay of receiving packets of data over a network
27
+
*`bitrateKbps` - the rate at which data is transmitted from the app to the server (publisher) or from the server to the app (subscriber)
28
+
29
+
`localStats` - object that contain the following data:
30
+
*`sfu` - the server we are connected to
31
+
*`sdkVersion` - the version of the Stream SDK
32
+
*`webRtcVersion` - the version of the webRTC
33
+
34
+
`latencyHistory` - array of latency values for the last 10 seconds
35
+
36
+
## Example usage
37
+
38
+
You can check the example of the stats screen in our [demo app](https://github.com/GetStream/stream-video-flutter/blob/main/dogfooding/lib/screens/call_stats_screen.dart)
0 commit comments