FRtcStats

Statistics of a call session.

USTRUCT(BlueprintType)
struct FRtcStats
{
	GENERATED_BODY()
public:
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|RtcStats")
	int64 duration = 0;
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|RtcStats")
	int64 txBytes = 0;
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|RtcStats")
	int64 rxBytes = 0;
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|RtcStats")
	int64 txAudioBytes = 0;
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|RtcStats")
	int64 txVideoBytes = 0;
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|RtcStats")
	int64 rxAudioBytes = 0;
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|RtcStats")
	int64 rxVideoBytes = 0;
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|RtcStats")
	int32 txKBitRate = 0;
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|RtcStats")
	int32 rxKBitRate = 0;
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|RtcStats")
	int32 rxAudioKBitRate = 0;
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|RtcStats")
	int32 txAudioKBitRate = 0;
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|RtcStats")
	int32 rxVideoKBitRate = 0;
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|RtcStats")
	int32 txVideoKBitRate = 0;
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|RtcStats")
	int32 lastmileDelay = 0;
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|RtcStats")
	int64 userCount = 0;
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|RtcStats")
	FString cpuAppUsage = "0";
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|RtcStats")
	FString cpuTotalUsage = "0";
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|RtcStats")
	int32 gatewayRtt = 0;
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|RtcStats")
	FString memoryAppUsageRatio = "0";
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|RtcStats")
	FString memoryTotalUsageRatio = "0";
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|RtcStats")
	int32 memoryAppUsageInKbytes = 0;
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|RtcStats")
	int32 connectTimeMs = 0;
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|RtcStats")
	int32 firstAudioPacketDuration = 0;
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|RtcStats")
	int32 firstVideoPacketDuration = 0;
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|RtcStats")
	int32 firstVideoKeyFramePacketDuration = 0;
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|RtcStats")
	int32 packetsBeforeFirstKeyFramePacket = 0;
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|RtcStats")
	int32 firstAudioPacketDurationAfterUnmute = 0;
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|RtcStats")
	int32 firstVideoPacketDurationAfterUnmute = 0;
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|RtcStats")
	int32 firstVideoKeyFramePacketDurationAfterUnmute = 0;
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|RtcStats")
	int32 firstVideoKeyFrameDecodedDurationAfterUnmute = 0;
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|RtcStats")
	int32 firstVideoKeyFrameRenderedDurationAfterUnmute = 0;
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|RtcStats")
	int32 txPacketLossRate = 0;
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|RtcStats")
	int32 rxPacketLossRate = 0;

	FRtcStats(){}
	FRtcStats(const agora::rtc::RtcStats & AgoraData){
		duration = AgoraData.duration;
		txBytes = AgoraData.txBytes;
		rxBytes = AgoraData.rxBytes;
		txAudioBytes = AgoraData.txAudioBytes;
		txVideoBytes = AgoraData.txVideoBytes;
		rxAudioBytes = AgoraData.rxAudioBytes;
		rxVideoBytes = AgoraData.rxVideoBytes;
		txKBitRate = AgoraData.txKBitRate;
		rxKBitRate = AgoraData.rxKBitRate;
		rxAudioKBitRate = AgoraData.rxAudioKBitRate;
		txAudioKBitRate = AgoraData.txAudioKBitRate;
		rxVideoKBitRate = AgoraData.rxVideoKBitRate;
		txVideoKBitRate = AgoraData.txVideoKBitRate;
		lastmileDelay = AgoraData.lastmileDelay;
		userCount = AgoraData.userCount;
		SET_UABT_DOUBLE_TO_FSTRING(this->cpuAppUsage, AgoraData.cpuAppUsage);
		SET_UABT_DOUBLE_TO_FSTRING(this->cpuTotalUsage, AgoraData.cpuTotalUsage);
		gatewayRtt = AgoraData.gatewayRtt;
		
		SET_UABT_DOUBLE_TO_FSTRING(this->memoryAppUsageRatio, AgoraData.memoryAppUsageRatio);
		SET_UABT_DOUBLE_TO_FSTRING(this->memoryTotalUsageRatio, AgoraData.memoryTotalUsageRatio);
		
		memoryAppUsageInKbytes = AgoraData.memoryAppUsageInKbytes;
		connectTimeMs = AgoraData.connectTimeMs;
		firstAudioPacketDuration = AgoraData.firstAudioPacketDuration;
		firstVideoPacketDuration = AgoraData.firstVideoPacketDuration;
		firstVideoKeyFramePacketDuration = AgoraData.firstVideoKeyFramePacketDuration;
		packetsBeforeFirstKeyFramePacket = AgoraData.packetsBeforeFirstKeyFramePacket;
		firstAudioPacketDurationAfterUnmute = AgoraData.firstAudioPacketDurationAfterUnmute;
		firstVideoPacketDurationAfterUnmute = AgoraData.firstVideoPacketDurationAfterUnmute;
		firstVideoKeyFramePacketDurationAfterUnmute = AgoraData.firstVideoKeyFramePacketDurationAfterUnmute;
		firstVideoKeyFrameDecodedDurationAfterUnmute = AgoraData.firstVideoKeyFrameDecodedDurationAfterUnmute;
		firstVideoKeyFrameRenderedDurationAfterUnmute = AgoraData.firstVideoKeyFrameRenderedDurationAfterUnmute;
		txPacketLossRate = AgoraData.txPacketLossRate;
		rxPacketLossRate = AgoraData.rxPacketLossRate;
	}

	agora::rtc::RtcStats CreateAgoraData(){
	
		agora::rtc::RtcStats AgoraData;
		AgoraData.duration = duration;
		AgoraData.txBytes = txBytes;
		AgoraData.rxBytes = rxBytes;
		AgoraData.txAudioBytes = txAudioBytes;
		AgoraData.txVideoBytes = txVideoBytes;
		AgoraData.rxAudioBytes = rxAudioBytes;
		AgoraData.rxVideoBytes = rxVideoBytes;
		AgoraData.txKBitRate = txKBitRate;
		AgoraData.rxKBitRate = rxKBitRate;
		AgoraData.rxAudioKBitRate = rxAudioKBitRate;
		AgoraData.txAudioKBitRate = txAudioKBitRate;
		AgoraData.rxVideoKBitRate = rxVideoKBitRate;
		AgoraData.txVideoKBitRate = txVideoKBitRate;
		AgoraData.lastmileDelay = lastmileDelay;
		AgoraData.userCount = userCount;
		SET_UABT_FSTRING_TO_DOUBLE(AgoraData.cpuAppUsage, this->cpuAppUsage);
		SET_UABT_FSTRING_TO_DOUBLE(AgoraData.cpuTotalUsage, this->cpuTotalUsage);
		AgoraData.gatewayRtt = gatewayRtt;
		SET_UABT_FSTRING_TO_DOUBLE(AgoraData.memoryAppUsageRatio, this->memoryAppUsageRatio);
		SET_UABT_FSTRING_TO_DOUBLE(AgoraData.memoryTotalUsageRatio, this->memoryTotalUsageRatio);
		AgoraData.memoryAppUsageInKbytes = memoryAppUsageInKbytes;
		AgoraData.connectTimeMs = connectTimeMs;
		AgoraData.firstAudioPacketDuration = firstAudioPacketDuration;
		AgoraData.firstVideoPacketDuration = firstVideoPacketDuration;
		AgoraData.firstVideoKeyFramePacketDuration = firstVideoKeyFramePacketDuration;
		AgoraData.packetsBeforeFirstKeyFramePacket = packetsBeforeFirstKeyFramePacket;
		AgoraData.firstAudioPacketDurationAfterUnmute = firstAudioPacketDurationAfterUnmute;
		AgoraData.firstVideoPacketDurationAfterUnmute = firstVideoPacketDurationAfterUnmute;
		AgoraData.firstVideoKeyFramePacketDurationAfterUnmute = firstVideoKeyFramePacketDurationAfterUnmute;
		AgoraData.firstVideoKeyFrameDecodedDurationAfterUnmute = firstVideoKeyFrameDecodedDurationAfterUnmute;
		AgoraData.firstVideoKeyFrameRenderedDurationAfterUnmute = firstVideoKeyFrameRenderedDurationAfterUnmute;
		AgoraData.txPacketLossRate = txPacketLossRate;
		AgoraData.rxPacketLossRate = rxPacketLossRate;
		return AgoraData;
	}
	void FreeAgoraData(agora::rtc::RtcStats & AgoraData) const {
	}
};

Attributes

duration
Call duration of the local user in seconds, represented by an aggregate value.
txBytes
The number of bytes sent.
rxBytes
The number of bytes received.
txAudioBytes
The total number of audio bytes sent, represented by an aggregate value.
txVideoBytes
The total number of video bytes sent, represented by an aggregate value.
rxAudioBytes
The total number of audio bytes received, represented by an aggregate value.
rxVideoBytes
The total number of video bytes received, represented by an aggregate value.
txKBitRate
The actual bitrate (Kbps) while sending the local video stream.
rxKBitRate
The receiving bitrate (Kbps).
rxAudioKBitRate
The bitrate (Kbps) of receiving the audio.
txAudioKBitRate
The bitrate (Kbps) of sending the audio packet.
rxVideoKBitRate
The bitrate (Kbps) of receiving the video.
txVideoKBitRate
The bitrate (Kbps) of sending the video.
lastmileDelay
The client-to-server delay (milliseconds).
txPacketLossRate
The packet loss rate (%) from the client to the Agora server before applying the anti-packet-loss algorithm.
rxPacketLossRate
The packet loss rate (%) from the Agora server to the client before using the anti-packet-loss method.
userCount
The number of users in the channel.
cpuAppUsage
Application CPU usage (%).
Attention:
  • The value of cpuAppUsage is always reported as 0 in the OnLeaveChannel callback.
  • As of Android 8.1, you cannot get the CPU usage from this attribute due to system limitations.
cpuTotalUsage

The system CPU usage (%).

For Windows, in the multi-kernel environment, this member represents the average CPU usage. The value = (100 - System Idle Progress in Task Manager)/100.

Attention:
  • The value of cpuTotalUsage is always reported as 0 in the OnLeaveChannel callback.
  • As of Android 8.1, you cannot get the CPU usage from this attribute due to system limitations.
connectTimeMs
The duration (ms) between the SDK starts connecting and the connection is established. If the value reported is 0, it means invalid.
gatewayRtt
The round-trip time delay (ms) from the client to the local router.
Note:

This property is disabled on devices running iOS 14 or later, and enabled on devices running versions earlier than iOS 14 by default.

To enable this property on devices running iOS 14 or later, technical support.

Note: On Android, to get gatewayRtt, ensure that you add the android.permission.ACCESS_WIFI_STATE permission after </application> in the AndroidManifest.xml file in your project.
memoryAppUsageRatio

The memory ratio occupied by the app (%).

Attention: This value is for reference only. Due to system limitations, you may not get this value.
memoryTotalUsageRatio

The memory occupied by the system (%).

Attention: This value is for reference only. Due to system limitations, you may not get this value.
memoryAppUsageInKbytes

The memory size occupied by the app (KB).

Attention: This value is for reference only. Due to system limitations, you may not get this value.