NIMSDK-AOS  10.6.0
AVChatSessionStats.java
浏览该文件的文档.
1 /*
2  * Copyright (c) 2014-2018 NetEase, Inc.
3  * All right reserved.
4  */
5 
6 package com.netease.nimlib.sdk.avchat.model;
7 
8 import com.netease.nrtc.sdk.NRtcConstants;
9 import com.netease.nrtc.sdk.common.statistics.SessionStats;
10 
11 import java.util.ArrayList;
12 
16 public class AVChatSessionStats {
17 
21  public int audioFreeze;
22 
26  public int audioGapPacket;
27 
31  public int audioTotalPacket;
32 
36  public long rxBytes;
37 
41  public long txBytes;
42 
47 
52 
53 
58 
63 
67  public long txAudioSentBitrate;
68 
69 
73  public long appCpuFreq;
74 
78  public long appMemoryUse;
79 
83  public long sysMemoryAvailable;
84 
88  public long sessionDuration;
89 
95  @Deprecated
96  public int sysCpuRate;
97 
103  @Deprecated
104  public int appCpuRate;
105 
109  private int sessionState;
110 
111 
115  public ArrayList<SimulcastVideo> simulcastVideos = new ArrayList<>(3);
116 
117 
118  public boolean isSessionStopped() {
119  return sessionState == SessionStats.State.STOPPED;
120  }
121 
122  public static AVChatSessionStats fork(SessionStats sessionStats) {
124  stats.sessionState = sessionStats.sessionState;
125  stats.audioFreeze = sessionStats.audioFreeze;
126  stats.audioGapPacket = sessionStats.audioGapPacket;
127  stats.audioTotalPacket = sessionStats.audioTotalPacket;
128  stats.rxAudioPacketsPerSecond = sessionStats.rxAudioPacketsPerSecond;
129  stats.rxVideoPacketsPerSecond = sessionStats.rxVideoPacketsPerSecond;
130  stats.txAudioPacketsPerSecond = sessionStats.txAudioPacketsPerSecond;
131  stats.txAudioEncodedBitrate = sessionStats.txAudioEncodedBitrate;
132  stats.txAudioSentBitrate = sessionStats.txAudioSentBitrate;
133  stats.rxBytes = sessionStats.rxBytes;
134  stats.txBytes = sessionStats.txBytes;
135  stats.appCpuFreq = sessionStats.appCpuFreq;
136  stats.appCpuRate = sessionStats.appCpuRate;
137  stats.appMemoryUse = sessionStats.appMemoryUse;
138  stats.sysMemoryAvailable = sessionStats.sysMemoryAvailable;
139  stats.sessionDuration = sessionStats.sessionDuration;
140  stats.sysCpuRate = sessionStats.sysCpuRate;
141 
142  for (SessionStats.SimulcastVideo video : sessionStats.simulcastVideos) {
143  stats.simulcastVideos.add(new SimulcastVideo(video));
144  }
145  return stats;
146  }
147 
151  public static class SimulcastVideo {
152 
159  public int videoType;
160 
161 
165  public int txVideoPacketsPerSecond;
166 
167 
171  public long txVideoEncodedBitrate;
172 
173 
177  public long txVideoSentBitrate;
178 
179 
180  public SimulcastVideo(SessionStats.SimulcastVideo video) {
181  this.videoType = video.videoType;
182  this.txVideoPacketsPerSecond = video.txVideoPacketsPerSecond;
183  this.txVideoEncodedBitrate = video.txVideoEncodedBitrate;
184  this.txVideoSentBitrate = video.txVideoSentBitrate;
185  }
186 
187 
188  @Override
189  public boolean equals(Object right) {
190 
191  if (this == right) {
192  return true;
193  }
194  if (right == null || getClass() != right.getClass()) {
195  return false;
196  }
197  SimulcastVideo video = (SimulcastVideo) right;
198  return videoType == video.videoType;
199  }
200 
201  @Override
202  public int hashCode() {
203  return videoType;
204  }
205 
206 
207  }
208 }
int audioGapPacket
语音卡顿数据包个数。周期性统计,结束时汇报整个会话的卡顿数据包个数。
long sysMemoryAvailable
当前设备可用内存(MB)
int rxVideoPacketsPerSecond
每秒接收的视频包个数,瞬时值
int rxAudioPacketsPerSecond
每秒接收的音频包个数,瞬时值
long txAudioSentBitrate
语音数据实际发送比特率,kbps
int txAudioPacketsPerSecond
每秒发送的音频包个数,瞬时值
int audioTotalPacket
语音数据包总数。周期性统计,数据时汇报整个会话的数据包总数。
int audioFreeze
语音卡播比。周期性统计,结束时汇报整个会话卡播比
long appMemoryUse
当前应用程序占用的内存(MB)
ArrayList< SimulcastVideo > simulcastVideos
多流相关的视频流统计数据(自己发布了并且有人订阅的流)
long appCpuFreq
实时获取的cpu当前频率,瞬时值(KHz)
static AVChatSessionStats fork(SessionStats sessionStats)
int appCpuRate
当前sdk所在进程的cpu使用率()