hyphenate_SDK3.0 3.9.9.2
hyphenate java IM SDK
|
继承自 com.hyphenate.chat.EMBase< T > .
类 | |
enum | EMSearchMessageDirect |
enum | EMSearchMessageType |
Public 成员函数 | |
EMMessageStatistics | getMessageStatistics (String messageId) |
int | getMessageCount (long startTimestamp, long endTimestamp, EMSearchMessageDirect direct, EMSearchMessageType type) |
long | getMessageSize (long startTimestamp, long endTimestamp, EMSearchMessageDirect direct, EMSearchMessageType type) |
\chinese 本地消息流量统计管理类。
该类中的方法可用于统计一定时间段内发送和/接收的指定类型的本地消息数量及其流量。
本地消息的流量统计功能默认关闭。若要使用该功能,需在 SDK 初始化前设置 EMOptions#setEnableStatistics(boolean) 开启。
SDK 只支持统计该功能开启后最近 30 天内发送和接收的消息。各类消息的流量计算方法如下:
注意
SDK 仅统计本地消息的流量,而非消息的实际流量。一般而言,该统计数据小于实际流量,原因如下:
\english The class for traffic statistics management of local messages.
This class contains methods that are used to calculate the number of local messages of certain types sent and/or received in a specified period, as well as their traffic.
This traffic statistics function is disabled by default. To use this function, you need to enable it by setting EMOptions#setEnableStatistics(boolean) prior to the SDK initialization.
The SDK only calculates the traffic of messages that are sent and received within the last 30 days after the traffic statistics function is enabled.
The message traffic is calculated as follows:
Note
The SDK only measures the traffic of local messages, but not the actual message traffic. Generally, the calculated traffic volume is smaller than the actual traffic because of the following:
int com.hyphenate.chat.EMStatisticsManager.getMessageCount | ( | long | startTimestamp, |
long | endTimestamp, | ||
EMSearchMessageDirect | direct, | ||
EMSearchMessageType | type | ||
) |
获取一定时间段内发送和/或接收的指定类型的消息条数。
startTimestamp | 起始时间戳,单位为毫秒。 |
endTimestamp | 结束时间戳,单位为毫秒。 |
direct | 消息方向。 |
type | 消息类型。 |
0
。 long com.hyphenate.chat.EMStatisticsManager.getMessageSize | ( | long | startTimestamp, |
long | endTimestamp, | ||
EMSearchMessageDirect | direct, | ||
EMSearchMessageType | type | ||
) |
获取一定时间段内发送和/或接收的指定类型的消息的总流量。
流量单位为字节。
消息流量的计算方法如下:
startTimestamp | 起始时间戳。 |
endTimestamp | 结束时间戳。 |
direct | 消息方向。 |
type | 消息类型。 |
0
。 EMMessageStatistics com.hyphenate.chat.EMStatisticsManager.getMessageStatistics | ( | String | messageId | ) |