# io.agora.rtc.RtcStats类 参考 (/zh-CN/api-reference/rtc-server-sdk/java/classio-1-1agora-1-1rtc-1-1-rtc-stats) > For AI agents: see the complete documentation index at [llms.txt](/llms.txt). RtcStats 类。 ## 构造及析构函数说明 [#构造及析构函数说明] ### RtcStats() [1/2] [#rtcstats-12] io.agora.rtc.RtcStats.RtcStats() ### RtcStats() [2/2] [#rtcstats-22] io.agora.rtc.RtcStats.RtcStats(int *connectionId*, int *duration*, int *txBytes*, int *rxBytes*, int *txAudioBytes*, int *txVideoBytes*, int *rxAudioBytes*, int *rxVideoBytes*, short *txKBitRate*, short *rxKBitRate*, short *rxAudioKBitRate*, short *txAudioKBitRate*, short *rxVideoKBitRate*, short *txVideoKBitRate*, short *lastmileDelay*, int *userCount*, double *cpuAppUsage*, double *cpuTotalUsage*, int *gatewayRtt*, double *memoryAppUsageRatio*, double *memoryTotalUsageRatio*, int *memoryAppUsageInKbytes*, int *connectTimeMs*, int *firstAudioPacketDuration*, int *firstVideoPacketDuration*, int *firstVideoKeyFramePacketDuration*, int *packetsBeforeFirstKeyFramePacket*, int *firstAudioPacketDurationAfterUnmute*, int *firstVideoPacketDurationAfterUnmute*, int *firstVideoKeyFramePacketDurationAfterUnmute*, int *firstVideoKeyFrameDecodedDurationAfterUnmute*, int *firstVideoKeyFrameRenderedDurationAfterUnmute*, int *txPacketLossRate*, int *rxPacketLossRate*) 构造函数。 连接 ID。 本地用户的通话时长,单位为秒,累计值。 发送字节数(bytes),累计值。 接收字节数(bytes),累计值。 发送音频字节数(bytes),累计值。 发送视频字节数(bytes),累计值。 接收音频字节数(bytes),累计值。 接收视频字节数(bytes),累计值。 发送码率(Kbps),瞬时值。 接收码率(Kbps),瞬时值。 音频接收码率(Kbps),瞬时值。 音频包的发送码率(Kbps),瞬时值。 视频接收码率(Kbps),瞬时值。 视频发送码率(Kbps),瞬时值。 客户端到服务器的延迟(毫秒)。 当前频道内的人数。 当前 App 的 CPU 使用率 (%)。 当前系统的 CPU 使用率 (%)。 客户端到本地路由器的往返时延 (ms)。 当前 App 的内存占比 (%)。 当前系统的内存占比 (%)。 当前 App 的内存大小 (KB)。 从开始建立连接到成功连接的时间(毫秒)。如报告 0,则表示无效。 从 SDK 开始连接 RTC 频道到接收到第一个音频包的时间(毫秒)。 从 SDK 开始连接 RTC 频道到接收到第一个视频包的时间(毫秒)。 从 SDK 开始连接 RTC 频道到接收到第一个视频关键帧的时间(毫秒)。 在收到第一个视频关键帧之前收到的视频包数量。 从最后一次恢复发送音频到接收到第一个音频包的时间(毫秒)。 从最后一次恢复发送视频到接收到第一个视频包的时间(毫秒)。 从最后一次恢复发送视频到接收到第一个视频关键帧的时间(毫秒)。 从最后一次恢复发送视频到接收到第一个视频关键帧解码的时间(毫秒)。 从最后一次恢复发送视频到接收到第一个视频帧关键帧渲染的时间(毫秒)。 发送端的丢包率。 接收端的丢包率。 ## 成员函数说明 [#成员函数说明] ### getConnectionId() [#getconnectionid] int io.agora.rtc.RtcStats.getConnectionId() ### getConnectTimeMs() [#getconnecttimems] int io.agora.rtc.RtcStats.getConnectTimeMs() ### getCpuAppUsage() [#getcpuappusage] double io.agora.rtc.RtcStats.getCpuAppUsage() ### getCpuTotalUsage() [#getcputotalusage] double io.agora.rtc.RtcStats.getCpuTotalUsage() ### getDuration() [#getduration] int io.agora.rtc.RtcStats.getDuration() ### getFirstAudioPacketDuration() [#getfirstaudiopacketduration] int io.agora.rtc.RtcStats.getFirstAudioPacketDuration() ### getFirstAudioPacketDurationAfterUnmute() [#getfirstaudiopacketdurationafterunmute] int io.agora.rtc.RtcStats.getFirstAudioPacketDurationAfterUnmute() ### getFirstVideoKeyFrameDecodedDurationAfterUnmute() [#getfirstvideokeyframedecodeddurationafterunmute] int io.agora.rtc.RtcStats.getFirstVideoKeyFrameDecodedDurationAfterUnmute() ### getFirstVideoKeyFramePacketDuration() [#getfirstvideokeyframepacketduration] int io.agora.rtc.RtcStats.getFirstVideoKeyFramePacketDuration() ### getFirstVideoKeyFramePacketDurationAfterUnmute() [#getfirstvideokeyframepacketdurationafterunmute] int io.agora.rtc.RtcStats.getFirstVideoKeyFramePacketDurationAfterUnmute() ### getFirstVideoKeyFrameRenderedDurationAfterUnmute() [#getfirstvideokeyframerendereddurationafterunmute] int io.agora.rtc.RtcStats.getFirstVideoKeyFrameRenderedDurationAfterUnmute() ### getFirstVideoPacketDuration() [#getfirstvideopacketduration] int io.agora.rtc.RtcStats.getFirstVideoPacketDuration() ### getFirstVideoPacketDurationAfterUnmute() [#getfirstvideopacketdurationafterunmute] int io.agora.rtc.RtcStats.getFirstVideoPacketDurationAfterUnmute() ### getGatewayRtt() [#getgatewayrtt] int io.agora.rtc.RtcStats.getGatewayRtt() ### getLastmileDelay() [#getlastmiledelay] short io.agora.rtc.RtcStats.getLastmileDelay() ### getMemoryAppUsageInKbytes() [#getmemoryappusageinkbytes] int io.agora.rtc.RtcStats.getMemoryAppUsageInKbytes() ### getMemoryAppUsageRatio() [#getmemoryappusageratio] double io.agora.rtc.RtcStats.getMemoryAppUsageRatio() ### getMemoryTotalUsageRatio() [#getmemorytotalusageratio] double io.agora.rtc.RtcStats.getMemoryTotalUsageRatio() ### getPacketsBeforeFirstKeyFramePacket() [#getpacketsbeforefirstkeyframepacket] int io.agora.rtc.RtcStats.getPacketsBeforeFirstKeyFramePacket() ### getRxAudioBytes() [#getrxaudiobytes] int io.agora.rtc.RtcStats.getRxAudioBytes() ### getRxAudioKBitRate() [#getrxaudiokbitrate] short io.agora.rtc.RtcStats.getRxAudioKBitRate() ### getRxBytes() [#getrxbytes] int io.agora.rtc.RtcStats.getRxBytes() ### getRxKBitRate() [#getrxkbitrate] short io.agora.rtc.RtcStats.getRxKBitRate() ### getRxPacketLossRate() [#getrxpacketlossrate] int io.agora.rtc.RtcStats.getRxPacketLossRate() ### getRxVideoBytes() [#getrxvideobytes] int io.agora.rtc.RtcStats.getRxVideoBytes() ### getRxVideoKBitRate() [#getrxvideokbitrate] short io.agora.rtc.RtcStats.getRxVideoKBitRate() ### getTxAudioBytes() [#gettxaudiobytes] int io.agora.rtc.RtcStats.getTxAudioBytes() ### getTxAudioKBitRate() [#gettxaudiokbitrate] short io.agora.rtc.RtcStats.getTxAudioKBitRate() ### getTxBytes() [#gettxbytes] int io.agora.rtc.RtcStats.getTxBytes() ### getTxKBitRate() [#gettxkbitrate] short io.agora.rtc.RtcStats.getTxKBitRate() ### getTxPacketLossRate() [#gettxpacketlossrate] int io.agora.rtc.RtcStats.getTxPacketLossRate() ### getTxVideoBytes() [#gettxvideobytes] int io.agora.rtc.RtcStats.getTxVideoBytes() ### getTxVideoKBitRate() [#gettxvideokbitrate] short io.agora.rtc.RtcStats.getTxVideoKBitRate() ### getUserCount() [#getusercount] int io.agora.rtc.RtcStats.getUserCount() ### setConnectionId() [#setconnectionid] void io.agora.rtc.RtcStats.setConnectionId(int *connectionId*) ### setConnectTimeMs() [#setconnecttimems] void io.agora.rtc.RtcStats.setConnectTimeMs(int *connectTimeMs*) ### setCpuAppUsage() [#setcpuappusage] void io.agora.rtc.RtcStats.setCpuAppUsage(double *cpuAppUsage*) ### setCpuTotalUsage() [#setcputotalusage] void io.agora.rtc.RtcStats.setCpuTotalUsage(double *cpuTotalUsage*) ### setDuration() [#setduration] void io.agora.rtc.RtcStats.setDuration(int *duration*) ### setFirstAudioPacketDuration() [#setfirstaudiopacketduration] void io.agora.rtc.RtcStats.setFirstAudioPacketDuration(int *firstAudioPacketDuration*) ### setFirstAudioPacketDurationAfterUnmute() [#setfirstaudiopacketdurationafterunmute] void io.agora.rtc.RtcStats.setFirstAudioPacketDurationAfterUnmute(int *firstAudioPacketDurationAfterUnmute*) ### setFirstVideoKeyFrameDecodedDurationAfterUnmute() [#setfirstvideokeyframedecodeddurationafterunmute] void io.agora.rtc.RtcStats.setFirstVideoKeyFrameDecodedDurationAfterUnmute(int *firstVideoKeyFrameDecodedDurationAfterUnmute*) ### setFirstVideoKeyFramePacketDuration() [#setfirstvideokeyframepacketduration] void io.agora.rtc.RtcStats.setFirstVideoKeyFramePacketDuration(int *firstVideoKeyFramePacketDuration*) ### setFirstVideoKeyFramePacketDurationAfterUnmute() [#setfirstvideokeyframepacketdurationafterunmute] void io.agora.rtc.RtcStats.setFirstVideoKeyFramePacketDurationAfterUnmute(int *firstVideoKeyFramePacketDurationAfterUnmute*) ### setFirstVideoKeyFrameRenderedDurationAfterUnmute() [#setfirstvideokeyframerendereddurationafterunmute] void io.agora.rtc.RtcStats.setFirstVideoKeyFrameRenderedDurationAfterUnmute(int *firstVideoKeyFrameRenderedDurationAfterUnmute*) ### setFirstVideoPacketDuration() [#setfirstvideopacketduration] void io.agora.rtc.RtcStats.setFirstVideoPacketDuration(int *firstVideoPacketDuration*) ### setFirstVideoPacketDurationAfterUnmute() [#setfirstvideopacketdurationafterunmute] void io.agora.rtc.RtcStats.setFirstVideoPacketDurationAfterUnmute(int *firstVideoPacketDurationAfterUnmute*) ### setGatewayRtt() [#setgatewayrtt] void io.agora.rtc.RtcStats.setGatewayRtt(int *gatewayRtt*) ### setLastmileDelay() [#setlastmiledelay] void io.agora.rtc.RtcStats.setLastmileDelay(short *lastmileDelay*) ### setMemoryAppUsageInKbytes() [#setmemoryappusageinkbytes] void io.agora.rtc.RtcStats.setMemoryAppUsageInKbytes(int *memoryAppUsageInKbytes*) ### setMemoryAppUsageRatio() [#setmemoryappusageratio] void io.agora.rtc.RtcStats.setMemoryAppUsageRatio(double *memoryAppUsageRatio*) ### setMemoryTotalUsageRatio() [#setmemorytotalusageratio] void io.agora.rtc.RtcStats.setMemoryTotalUsageRatio(double *memoryTotalUsageRatio*) ### setPacketsBeforeFirstKeyFramePacket() [#setpacketsbeforefirstkeyframepacket] void io.agora.rtc.RtcStats.setPacketsBeforeFirstKeyFramePacket(int *packetsBeforeFirstKeyFramePacket*) ### setRxAudioBytes() [#setrxaudiobytes] void io.agora.rtc.RtcStats.setRxAudioBytes(int *rxAudioBytes*) ### setRxAudioKBitRate() [#setrxaudiokbitrate] void io.agora.rtc.RtcStats.setRxAudioKBitRate(short *rxAudioKBitRate*) ### setRxBytes() [#setrxbytes] void io.agora.rtc.RtcStats.setRxBytes(int *rxBytes*) ### setRxKBitRate() [#setrxkbitrate] void io.agora.rtc.RtcStats.setRxKBitRate(short *rxKBitRate*) ### setRxPacketLossRate() [#setrxpacketlossrate] void io.agora.rtc.RtcStats.setRxPacketLossRate(int *rxPacketLossRate*) ### setRxVideoBytes() [#setrxvideobytes] void io.agora.rtc.RtcStats.setRxVideoBytes(int *rxVideoBytes*) ### setRxVideoKBitRate() [#setrxvideokbitrate] void io.agora.rtc.RtcStats.setRxVideoKBitRate(short *rxVideoKBitRate*) ### setTxAudioBytes() [#settxaudiobytes] void io.agora.rtc.RtcStats.setTxAudioBytes(int *txAudioBytes*) ### setTxAudioKBitRate() [#settxaudiokbitrate] void io.agora.rtc.RtcStats.setTxAudioKBitRate(short *txAudioKBitRate*) ### setTxBytes() [#settxbytes] void io.agora.rtc.RtcStats.setTxBytes(int *txBytes*) ### setTxKBitRate() [#settxkbitrate] void io.agora.rtc.RtcStats.setTxKBitRate(short *txKBitRate*) ### setTxPacketLossRate() [#settxpacketlossrate] void io.agora.rtc.RtcStats.setTxPacketLossRate(int *txPacketLossRate*) ### setTxVideoBytes() [#settxvideobytes] void io.agora.rtc.RtcStats.setTxVideoBytes(int *txVideoBytes*) ### setTxVideoKBitRate() [#settxvideokbitrate] void io.agora.rtc.RtcStats.setTxVideoKBitRate(short *txVideoKBitRate*) ### setUserCount() [#setusercount] void io.agora.rtc.RtcStats.setUserCount(int *userCount*) ## 类成员变量说明 [#类成员变量说明] ### connectionId [#connectionid] int io.agora.rtc.RtcStats.connectionId ### connectTimeMs [#connecttimems] int io.agora.rtc.RtcStats.connectTimeMs ### cpuAppUsage [#cpuappusage] double io.agora.rtc.RtcStats.cpuAppUsage ### cpuTotalUsage [#cputotalusage] double io.agora.rtc.RtcStats.cpuTotalUsage ### duration [#duration] int io.agora.rtc.RtcStats.duration ### firstAudioPacketDuration [#firstaudiopacketduration] int io.agora.rtc.RtcStats.firstAudioPacketDuration ### firstAudioPacketDurationAfterUnmute [#firstaudiopacketdurationafterunmute] int io.agora.rtc.RtcStats.firstAudioPacketDurationAfterUnmute ### firstVideoKeyFrameDecodedDurationAfterUnmute [#firstvideokeyframedecodeddurationafterunmute] int io.agora.rtc.RtcStats.firstVideoKeyFrameDecodedDurationAfterUnmute ### firstVideoKeyFramePacketDuration [#firstvideokeyframepacketduration] int io.agora.rtc.RtcStats.firstVideoKeyFramePacketDuration ### firstVideoKeyFramePacketDurationAfterUnmute [#firstvideokeyframepacketdurationafterunmute] int io.agora.rtc.RtcStats.firstVideoKeyFramePacketDurationAfterUnmute ### firstVideoKeyFrameRenderedDurationAfterUnmute [#firstvideokeyframerendereddurationafterunmute] int io.agora.rtc.RtcStats.firstVideoKeyFrameRenderedDurationAfterUnmute ### firstVideoPacketDuration [#firstvideopacketduration] int io.agora.rtc.RtcStats.firstVideoPacketDuration ### firstVideoPacketDurationAfterUnmute [#firstvideopacketdurationafterunmute] int io.agora.rtc.RtcStats.firstVideoPacketDurationAfterUnmute ### gatewayRtt [#gatewayrtt] int io.agora.rtc.RtcStats.gatewayRtt ### lastmileDelay [#lastmiledelay] short io.agora.rtc.RtcStats.lastmileDelay ### memoryAppUsageInKbytes [#memoryappusageinkbytes] int io.agora.rtc.RtcStats.memoryAppUsageInKbytes ### memoryAppUsageRatio [#memoryappusageratio] double io.agora.rtc.RtcStats.memoryAppUsageRatio ### memoryTotalUsageRatio [#memorytotalusageratio] double io.agora.rtc.RtcStats.memoryTotalUsageRatio ### packetsBeforeFirstKeyFramePacket [#packetsbeforefirstkeyframepacket] int io.agora.rtc.RtcStats.packetsBeforeFirstKeyFramePacket ### rxAudioBytes [#rxaudiobytes] int io.agora.rtc.RtcStats.rxAudioBytes ### rxAudioKBitRate [#rxaudiokbitrate] short io.agora.rtc.RtcStats.rxAudioKBitRate ### rxBytes [#rxbytes] int io.agora.rtc.RtcStats.rxBytes ### rxKBitRate [#rxkbitrate] short io.agora.rtc.RtcStats.rxKBitRate ### rxPacketLossRate [#rxpacketlossrate] int io.agora.rtc.RtcStats.rxPacketLossRate ### rxVideoBytes [#rxvideobytes] int io.agora.rtc.RtcStats.rxVideoBytes ### rxVideoKBitRate [#rxvideokbitrate] short io.agora.rtc.RtcStats.rxVideoKBitRate ### txAudioBytes [#txaudiobytes] int io.agora.rtc.RtcStats.txAudioBytes ### txAudioKBitRate [#txaudiokbitrate] short io.agora.rtc.RtcStats.txAudioKBitRate ### txBytes [#txbytes] int io.agora.rtc.RtcStats.txBytes ### txKBitRate [#txkbitrate] short io.agora.rtc.RtcStats.txKBitRate ### txPacketLossRate [#txpacketlossrate] int io.agora.rtc.RtcStats.txPacketLossRate ### txVideoBytes [#txvideobytes] int io.agora.rtc.RtcStats.txVideoBytes ### txVideoKBitRate [#txvideokbitrate] short io.agora.rtc.RtcStats.txVideoKBitRate ### userCount [#usercount] int io.agora.rtc.RtcStats.userCount --- 该类的文档由以下文件生成: - RtcStats.java