UNPKG

appium-android-driver

Version:

Android UiAutomator and Chrome support for Appium

96 lines 5.23 kB
/** * @this {AndroidDriver} * @returns {Promise<import('./types').PerformanceDataType[]>} */ export function getPerformanceDataTypes(this: import("../driver").AndroidDriver): Promise<import("./types").PerformanceDataType[]>; /** * @this {AndroidDriver} * @param {string} packageName * @param {string} dataType * @param {number} [retries=2] * @returns {Promise<any[][]>} */ export function getPerformanceData(this: import("../driver").AndroidDriver, packageName: string, dataType: string, retries?: number): Promise<any[][]>; /** * Retrieves performance data about the given Android subsystem. * The data is parsed from the output of the dumpsys utility. * * The output depends on the selected subsystem. * It is orginized into a table, where the first row represent column names * and the following rows represent the sampled data for each column. * Example output for different data types: * - batteryinfo: [[power], [23]] * - memory info: [[totalPrivateDirty, nativePrivateDirty, dalvikPrivateDirty, eglPrivateDirty, glPrivateDirty, totalPss, * nativePss, dalvikPss, eglPss, glPss, nativeHeapAllocatedSize, nativeHeapSize], [18360, 8296, 6132, null, null, 42588, 8406, 7024, null, null, 26519, 10344]] * - networkinfo: [[bucketStart, activeTime, rxBytes, rxPackets, txBytes, txPackets, operations, bucketDuration,], * [1478091600000, null, 1099075, 610947, 928, 114362, 769, 0, 3600000], [1478095200000, null, 1306300, 405997, 509, 46359, 370, 0, 3600000]] * * [[st, activeTime, rb, rp, tb, tp, op, bucketDuration], [1478088000, null, null, 32115296, 34291, 2956805, 25705, 0, 3600], * [1478091600, null, null, 2714683, 11821, 1420564, 12650, 0, 3600], [1478095200, null, null, 10079213, 19962, 2487705, 20015, 0, 3600], * [1478098800, null, null, 4444433, 10227, 1430356, 10493, 0, 3600]] * - cpuinfo: [[user, kernel], [0.9, 1.3]] * * @this {AndroidDriver} * @param {string} packageName The name of the package identifier to fetch the data for * @param {import('./types').PerformanceDataType} dataType One of supported subsystem to fetch the data for. * @returns {Promise<any[][]>} */ export function mobileGetPerformanceData(this: import("../driver").AndroidDriver, packageName: string, dataType: import("./types").PerformanceDataType): Promise<any[][]>; /** * * @this {AndroidDriver} * @param {string} packageName * @param {number} retries */ export function getMemoryInfo(this: import("../driver").AndroidDriver, packageName: string, retries?: number): Promise<any[][] | null>; /** * @this {AndroidDriver} * @param {number} retries */ export function getNetworkTrafficInfo(this: import("../driver").AndroidDriver, retries?: number): Promise<(string | undefined)[][] | null>; /** * Return the CPU information related to the given packageName. * It raises an exception if the dumped CPU information did not include the given packageName * or the format was wrong. * The CPU information's sampling interval depends on the device under test. * For example, some devices have 5 minutes interval. When you get the information * from 2023-02-07 11:59:40.468 to 2023-02-07 12:04:40.556, then the next will be * from 2023-02-07 12:04:40.556 to 2023-02-07 12:09:40.668. No process information * exists in the result if the process was not running during the period. * * @this {AndroidDriver} * @param {string} packageName The package name to get the CPU information. * @param {number} retries The number of retry count. * @returns {Promise<[typeof CPU_KEYS, [user: string, kernel: string]]>} The array of the parsed CPU upsage percentages. * e.g. ['cpuinfo', ['14.3', '28.2']] * '14.3' is usage by the user (%), '28.2' is usage by the kernel (%) * @throws {Error} If it failed to parse the result of dumpsys, or no package name exists. */ export function getCPUInfo(this: import("../driver").AndroidDriver, packageName: string, retries?: number): Promise<[typeof CPU_KEYS, [user: string, kernel: string]]>; /** * @this {AndroidDriver} * @param {number} retries */ export function getBatteryInfo(this: import("../driver").AndroidDriver, retries?: number): Promise<string[][] | null>; export const NETWORK_KEYS: string[][]; export const CPU_KEYS: readonly ["user", "kernel"]; export const BATTERY_KEYS: string[]; export const MEMORY_KEYS: string[]; export const SUPPORTED_PERFORMANCE_DATA_TYPES: Readonly<{ cpuinfo: "the amount of cpu by user and kernel process - cpu information for applications on real devices and simulators"; memoryinfo: "the amount of memory used by the process - memory information for applications on real devices and simulators"; batteryinfo: "the remaining battery power - battery power information for applications on real devices and simulators"; networkinfo: "the network statistics - network rx/tx information for applications on real devices and simulators"; }>; export const MEMINFO_TITLES: Readonly<{ NATIVE: "Native"; DALVIK: "Dalvik"; EGL: "EGL"; GL: "GL"; MTRACK: "mtrack"; TOTAL: "TOTAL"; HEAP: "Heap"; }>; export type AndroidDriver = import("../driver").AndroidDriver; export type ADB = import("appium-adb").ADB; //# sourceMappingURL=performance.d.ts.map