RtcStats

Call-related statistics.

class RtcStats {
  const RtcStats(
      {this.duration,
      this.txBytes,
      this.rxBytes,
      this.txAudioBytes,
      this.txVideoBytes,
      this.rxAudioBytes,
      this.rxVideoBytes,
      this.txKBitRate,
      this.rxKBitRate,
      this.rxAudioKBitRate,
      this.txAudioKBitRate,
      this.rxVideoKBitRate,
      this.txVideoKBitRate,
      this.lastmileDelay,
      this.userCount,
      this.cpuAppUsage,
      this.cpuTotalUsage,
      this.gatewayRtt,
      this.memoryAppUsageRatio,
      this.memoryTotalUsageRatio,
      this.memoryAppUsageInKbytes,
      this.connectTimeMs,
      this.firstAudioPacketDuration,
      this.firstVideoPacketDuration,
      this.firstVideoKeyFramePacketDuration,
      this.packetsBeforeFirstKeyFramePacket,
      this.firstAudioPacketDurationAfterUnmute,
      this.firstVideoPacketDurationAfterUnmute,
      this.firstVideoKeyFramePacketDurationAfterUnmute,
      this.firstVideoKeyFrameDecodedDurationAfterUnmute,
      this.firstVideoKeyFrameRenderedDurationAfterUnmute,
      this.txPacketLossRate,
      this.rxPacketLossRate});

  @JsonKey(name: 'duration')
  final int? duration;
  @JsonKey(name: 'txBytes')
  final int? txBytes;
  @JsonKey(name: 'rxBytes')
  final int? rxBytes;
  @JsonKey(name: 'txAudioBytes')
  final int? txAudioBytes;
  @JsonKey(name: 'txVideoBytes')
  final int? txVideoBytes;
  @JsonKey(name: 'rxAudioBytes')
  final int? rxAudioBytes;
  @JsonKey(name: 'rxVideoBytes')
  final int? rxVideoBytes;
  @JsonKey(name: 'txKBitRate')
  final int? txKBitRate;
  @JsonKey(name: 'rxKBitRate')
  final int? rxKBitRate;
  @JsonKey(name: 'rxAudioKBitRate')
  final int? rxAudioKBitRate;
  @JsonKey(name: 'txAudioKBitRate')
  final int? txAudioKBitRate;
  @JsonKey(name: 'rxVideoKBitRate')
  final int? rxVideoKBitRate;
  @JsonKey(name: 'txVideoKBitRate')
  final int? txVideoKBitRate;
  @JsonKey(name: 'lastmileDelay')
  final int? lastmileDelay;
  @JsonKey(name: 'userCount')
  final int? userCount;
  @JsonKey(name: 'cpuAppUsage')
  final double? cpuAppUsage;
  @JsonKey(name: 'cpuTotalUsage')
  final double? cpuTotalUsage;
  @JsonKey(name: 'gatewayRtt')
  final int? gatewayRtt;
  @JsonKey(name: 'memoryAppUsageRatio')
  final double? memoryAppUsageRatio;
  @JsonKey(name: 'memoryTotalUsageRatio')
  final double? memoryTotalUsageRatio;
  @JsonKey(name: 'memoryAppUsageInKbytes')
  final int? memoryAppUsageInKbytes;
  @JsonKey(name: 'connectTimeMs')
  final int? connectTimeMs;
  @JsonKey(name: 'firstAudioPacketDuration')
  final int? firstAudioPacketDuration;
  @JsonKey(name: 'firstVideoPacketDuration')
  final int? firstVideoPacketDuration;
  @JsonKey(name: 'firstVideoKeyFramePacketDuration')
  final int? firstVideoKeyFramePacketDuration;
  @JsonKey(name: 'packetsBeforeFirstKeyFramePacket')
  final int? packetsBeforeFirstKeyFramePacket;
  @JsonKey(name: 'firstAudioPacketDurationAfterUnmute')
  final int? firstAudioPacketDurationAfterUnmute;
  @JsonKey(name: 'firstVideoPacketDurationAfterUnmute')
  final int? firstVideoPacketDurationAfterUnmute;
  @JsonKey(name: 'firstVideoKeyFramePacketDurationAfterUnmute')
  final int? firstVideoKeyFramePacketDurationAfterUnmute;
  @JsonKey(name: 'firstVideoKeyFrameDecodedDurationAfterUnmute')
  final int? firstVideoKeyFrameDecodedDurationAfterUnmute;
  @JsonKey(name: 'firstVideoKeyFrameRenderedDurationAfterUnmute')
  final int? firstVideoKeyFrameRenderedDurationAfterUnmute;
  @JsonKey(name: 'txPacketLossRate')
  final int? txPacketLossRate;
  @JsonKey(name: 'rxPacketLossRate')
  final int? rxPacketLossRate;
  factory RtcStats.fromJson(Map<String, dynamic> json) =>
      _$RtcStatsFromJson(json);
  Map<String, dynamic> toJson() => _$RtcStatsToJson(this);
}

Properties

duration
Call duration of the local user (seconds), cumulative value.
txBytes
Bytes sent.
rxBytes
Bytes received.
txAudioBytes
Audio bytes sent, cumulative value.
txVideoBytes
Video bytes sent, cumulative value.
rxAudioBytes
Audio bytes received, cumulative value.
rxVideoBytes
Video bytes received, cumulative value.
txKBitRate
Sending bitrate (Kbps).
rxKBitRate
Receiving bitrate (Kbps).
rxAudioKBitRate
Audio receiving bitrate (Kbps).
txAudioKBitRate
Audio packet sending bitrate (Kbps).
rxVideoKBitRate
Video receiving bitrate (Kbps).
txVideoKBitRate
Video sending bitrate (Kbps).
lastmileDelay
Client-to-access-server latency (milliseconds).
txPacketLossRate
Uplink packet loss rate (%) from client to server before applying anti-packet-loss technology.
rxPacketLossRate
Downlink packet loss rate (%) from server to client before applying anti-packet-loss technology.
userCount
Number of users in the current channel.
cpuAppUsage
CPU usage (%) of the current app.
Note:
  • The cpuAppUsage reported in the onLeaveChannel callback is always 0.
  • Starting from Android 8.1, due to system limitations, you may not be able to obtain CPU usage via this property.
cpuTotalUsage
CPU usage (%) of the current system. For Windows platform, in multi-core environments, this member indicates the average usage of multi-core CPUs. The calculation is (100 - CPU usage of system idle process shown in Task Manager)/100.
Note:
  • The cpuTotalUsage reported in the onLeaveChannel callback is always 0.
connectTimeMs
Time from starting to establish connection to successful connection (milliseconds). A value of 0 indicates invalid.
gatewayRtt
Round-trip time from client to local router (ms).
Note: This property is enabled by default on devices running iOS versions earlier than 14, and disabled on iOS 14 and later. To enable this property on iOS 14 and later, please contact technical support. On Android, to obtain gatewayRtt, make sure you have added the android.permission.ACCESS_WIFI_STATE permission after </application> in your project's AndroidManifest.xml file.
memoryAppUsageRatio
Memory usage ratio (%) of the current app.
Note: This value is for reference only. It may not be retrievable due to system limitations.
memoryTotalUsageRatio
Memory usage ratio (%) of the current system.
Note: This value is for reference only. It may not be retrievable due to system limitations.
memoryAppUsageInKbytes
Memory usage of the current app (KB).
Note: This value is for reference only. It may not be retrievable due to system limitations.