FRtcStats
通话相关的统计信息。
C++
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 {
}
};
duration
本地用户通话时长(秒),累计值。
txBytes
发送字节数 (bytes)。
rxBytes
接收字节数 (bytes)。
txAudioBytes
发送音频字节数 (bytes),累计值。
txVideoBytes
发送视频字节数 (bytes),累计值。
rxAudioBytes
接收音频字节数 (bytes),累计值。
rxVideoBytes
接收视频字节数 (bytes),累计值。
txKBitRate
发送码率 (Kbps)。
rxKBitRate
接收码率 (Kbps)。
rxAudioKBitRate
音频接收码率 (Kbps)。
txAudioKBitRate
音频包的发送码率 (Kbps)。
rxVideoKBitRate
视频接收码率 (Kbps)。
txVideoKBitRate
视频发送码率 (Kbps)。
lastmileDelay
客户端-接入服务器延时 (毫秒)。
txPacketLossRate
使用抗丢包技术前,客户端上行发送到服务器丢包率 (%)。
rxPacketLossRate
使用抗丢包技术前,服务器下行发送到客户端丢包率 (%)。
userCount
当前频道内的用户人数。
cpuAppUsage
当前 App 的 CPU 使用率 (%)。
注意
- OnLeaveChannel 回调中报告的 cpuAppUsage 恒为 0。
- 自 Android 8.1 起,因系统限制,你可能无法通过该属性获取 CPU 使用率。
cpuTotalUsage
当前系统的 CPU 使用率 (%)。
对于 Windows 平台,在多核环境中,该成员指多核 CPU 的平均使用率。 计算方式为 (100 - 任务管理中显示的系统空闲进程 CPU)/100。
注意
- OnLeaveChannel 回调中报告的 cpuTotalUsage 恒为 0。
- 自 Android 8.1 起,因系统限制,你无法通过该属性获取 CPU 使用率。
connectTimeMs
从开始建立连接到成功连接的时间(毫秒)。如报告 0,则表示无效。
gatewayRtt
客户端到本地路由器的往返时延 (ms)。
信息
该属性默认在 iOS 14 之前的设备上开启,在 iOS 14 及之后的设备上关闭。
如需在 iOS 14 及之后的设备上启用该属性,请联系技术支持。
信息
在 Android 平台上,如需获取 gatewayRtt,请确保已在项目
AndroidManifest.xml
文件的 </application>
后面添加 android.permission.ACCESS_WIFI_STATE
权限。memoryAppUsageRatio
当前 App 的内存占比 (%)。
注意
该值仅作参考。受系统限制可能无法获取。
memoryTotalUsageRatio
当前系统的内存占比 (%)。
注意
该值仅作参考。受系统限制可能无法获取。
memoryAppUsageInKbytes
当前 App 的内存大小 (KB)。
注意
该值仅作参考。受系统限制可能无法获取。