Chat SDK for Android v1.2.1
agora java chat SDK
|
Inherits io.agora.chat.EMBase< T >.
Classes | |
enum | SearchMessageDirect |
enum | SearchMessageType |
Public Member Functions | |
MessageStatistics | getMessageStatistics (String messageId) |
int | getMessageCount (long startTimestamp, long endTimestamp, SearchMessageDirect direct, SearchMessageType type) |
long | getMessageSize (long startTimestamp, long endTimestamp, SearchMessageDirect direct, SearchMessageType type) |
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 ChatOptions#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 io.agora.chat.ChatStatisticsManager.getMessageCount | ( | long | startTimestamp, |
long | endTimestamp, | ||
SearchMessageDirect | direct, | ||
SearchMessageType | type | ||
) |
Gets the count of messages of certain types that are sent and/or received in a specified period.
startTimestamp | The starting timestamp for statistics. The unit is millisecond. |
endTimestamp | The ending timestamp for statistics. The unit is millisecond. |
direct | The message direction. |
type | The message type. |
0
is returned in the case of a call failure. long io.agora.chat.ChatStatisticsManager.getMessageSize | ( | long | startTimestamp, |
long | endTimestamp, | ||
SearchMessageDirect | direct, | ||
SearchMessageType | type | ||
) |
Gets the total traffic volume of messages of certain types that are sent and/or received in a specified period.
The traffic is measured in bytes.
The message traffic is calculated as follows:
startTimestamp | The starting timestamp for statistics. The unit is millisecond. |
endTimestamp | The ending timestamp for statistics. The unit is millisecond. |
direct | The message direction. |
type | The message type. |
0
is returned in the case of a call failure. MessageStatistics io.agora.chat.ChatStatisticsManager.getMessageStatistics | ( | String | messageId | ) |
Gets message traffic statistics by message ID.
messageId | The message ID. |