流量统计

Signed-off-by: xujie <xujie223@huawei.com>
This commit is contained in:
徐杰 2023-10-31 03:16:18 +00:00 committed by liuxiyao
parent f97bd96678
commit 30c8236fb2

View File

@ -342,6 +342,58 @@ declare namespace statistics {
*/
function getTrafficStatsByUid(uidInfo: UidInfo): Promise<NetStatsInfo>;
/**
* Queries the data traffic (including all TCP and UDP data packets) received through a specified sockfd.
* @param { number } sockfd - Indicates the file descriptor of the given socket.
* @param { AsyncCallback<number> } callback - Returns the data traffic bytes received by the specified sockfd.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2100001 - Invalid parameter value.
* @throws { BusinessError } 2100002 - Operation failed. Cannot connect to service.
* @throws { BusinessError } 2100003 - System internal error.
* @syscap SystemCapability.Communication.NetManager.Core
* @since 11
*/
function getSockfdRxBytes(sockfd: number, callback: AsyncCallback<number>): void;
/**
* Queries the data traffic (including all TCP and UDP data packets) received through a specified sockfd.
* @param { number } sockfd - Indicates the file descriptor of the given socket.
* @returns { Promise<number> } Returns the data traffic bytes received by the specified sockfd.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2100001 - Invalid parameter value.
* @throws { BusinessError } 2100002 - Operation failed. Cannot connect to service.
* @throws { BusinessError } 2100003 - System internal error.
* @syscap SystemCapability.Communication.NetManager.Core
* @since 11
*/
function getSockfdRxBytes(sockfd: number): Promise<number>;
/**
* Queries the data traffic (including all TCP and UDP data packets) sent through a specified sockfd.
* @param { number } sockfd - Indicates the file descriptor of the given socket.
* @param { AsyncCallback<number> } callback - Returns the data traffic bytes sent by the specified sockfd.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2100001 - Invalid parameter value
* @throws { BusinessError } 2100002 - Operation failed. Cannot connect to service.
* @throws { BusinessError } 2100003 - System internal error.
* @syscap SystemCapability.Communication.NetManager.Core
* @since 11
*/
function getSockfdTxBytes(sockfd: number, callback: AsyncCallback<number>): void;
/**
* Queries the data traffic (including all TCP and UDP data packets) sent through a specified sockfd.
* @param { number } sockfd - Indicates the file descriptor of the given socket.
* @returns { Promise<number> } Returns the data traffic bytes sent by the specified sockfd.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2100001 - Invalid parameter value
* @throws { BusinessError } 2100002 - Operation failed. Cannot connect to service.
* @throws { BusinessError } 2100003 - System internal error.
* @syscap SystemCapability.Communication.NetManager.Core
* @since 11
*/
function getSockfdTxBytes(sockfd: number): Promise<number>;
/**
* Parameters for obtaining detailed information on network interface traffic usage.
* @interface IfaceInfo
@ -451,4 +503,4 @@ declare namespace statistics {
}
}
export default statistics;
export default statistics;