# RtcStats (/zh-CN/api-reference/rtc/unreal-cpp/class-rtcstats)
> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).
```cpp
struct RtcStats {
unsigned int duration;
unsigned int txBytes;
unsigned int rxBytes;
unsigned int txAudioBytes;
unsigned int txVideoBytes;
unsigned int rxAudioBytes;
unsigned int rxVideoBytes;
unsigned short txKBitRate;
unsigned short rxKBitRate;
unsigned short rxAudioKBitRate;
unsigned short txAudioKBitRate;
unsigned short rxVideoKBitRate;
unsigned short txVideoKBitRate;
unsigned short lastmileDelay;
unsigned int userCount;
double cpuAppUsage;
double cpuTotalUsage;
int gatewayRtt;
double memoryAppUsageRatio;
double memoryTotalUsageRatio;
int memoryAppUsageInKbytes;
int connectTimeMs;
int txPacketLossRate;
int rxPacketLossRate;
RtcStats() :
duration(0),
txBytes(0),
rxBytes(0),
txAudioBytes(0),
txVideoBytes(0),
rxAudioBytes(0),
rxVideoBytes(0),
txKBitRate(0),
rxKBitRate(0),
rxAudioKBitRate(0),
txAudioKBitRate(0),
rxVideoKBitRate(0),
txVideoKBitRate(0),
lastmileDelay(0),
userCount(0),
cpuAppUsage(0.0),
cpuTotalUsage(0.0),
gatewayRtt(0),
memoryAppUsageRatio(0.0),
memoryTotalUsageRatio(0.0),
memoryAppUsageInKbytes(0),
connectTimeMs(0),
txPacketLossRate(0),
rxPacketLossRate(0) {}
};
```
## 属性 [#属性]
本地用户通话时长(秒),累计值。
发送字节数 (bytes)。
接收字节数 (bytes)。
发送音频字节数 (bytes),累计值。
发送视频字节数 (bytes),累计值。
接收音频字节数 (bytes),累计值。
接收视频字节数 (bytes),累计值。
发送码率 (Kbps)。
接收码率 (Kbps)。
音频接收码率 (Kbps)。
音频包的发送码率 (Kbps)。
视频接收码率 (Kbps)。
视频发送码率 (Kbps)。
客户端-接入服务器延时 (毫秒)。
使用抗丢包技术前,客户端上行发送到服务器丢包率 (%)。
使用抗丢包技术前,服务器下行发送到客户端丢包率 (%)。
当前频道内的用户人数。
当前 App 的 CPU 使用率 (%)。
:::caution
注意:
- [onLeaveChannel](/zh-CN/api-reference/rtc/unreal-cpp/channel#callback_irtcengineeventhandler_onleavechannel) 回调中报告的 cpuAppUsage 恒为 0。
- 自 Android 8.1 起,因系统限制,你可能无法通过该属性获取 CPU 使用率。
:::
当前系统的 CPU 使用率 (%)。
对于 Windows 平台,在多核环境中,该成员指多核 CPU 的平均使用率。 计算方式为 (100 - 任务管理中显示的系统空闲进程 CPU)/100。
:::caution
注意:
- [onLeaveChannel](/zh-CN/api-reference/rtc/unreal-cpp/channel#callback_irtcengineeventhandler_onleavechannel) 回调中报告的 cpuTotalUsage 恒为 0。
- 自 Android 8.1 起,因系统限制,你无法通过该属性获取 CPU 使用率。
:::
从开始建立连接到成功连接的时间(毫秒)。如报告 0,则表示无效。
客户端到本地路由器的往返时延 (ms)。
:::note
注:
该属性默认在 iOS 14 之前的设备上开启,在 iOS 14 及之后的设备上关闭。
如需在 iOS 14 及之后的设备上启用该属性,请[联系技术支持](https://ticket.shengwang.cn/)。
:::
:::note
注: 在 Android 平台上,如需获取 gatewayRtt,请确保已在项目 `AndroidManifest.xml` 文件的 `` 后面添加 `android.permission.ACCESS_WIFI_STATE` 权限。
:::
当前 App 的内存占比 (%)。
:::caution
注意: 该值仅作参考。受系统限制可能无法获取。
:::
当前系统的内存占比 (%)。
:::caution
注意: 该值仅作参考。受系统限制可能无法获取。
:::
当前 App 的内存大小 (KB)。
:::caution
注意: 该值仅作参考。受系统限制可能无法获取。
:::