getPerformanceData
Get performance data for a specific application. Returns system state information like cpu,
memory, network traffic, and battery. Use getPerformanceDataTypes() to find available
data types.
Note: Falls back to the deprecated Appium 2 protocol endpoint if the driver does not support the
mobile:execute method.
Usage
browser.getPerformanceData(packageName, dataType, dataReadTimeout)
Parameters
| Name | Type | Details |
|---|---|---|
packageName | string | The package name of the application to get performance data for |
dataType | string | The type of performance data to retrieve (e.g. cpuinfo, memoryinfo) |
dataReadTimeoutoptional | number | Timeout in seconds to wait for the data to be read |
Example
getPerformanceData.js
it('should get performance data for an app', async () => {
// Get available data types first
const types = await browser.getPerformanceDataTypes()
// Get CPU info for an app
const cpuData = await browser.getPerformanceData('com.example.app', 'cpuinfo', 5)
})
Returns
- <
Promise<string[]>>returns: Performance data for the requested type
Support
참고
Refer to the official Appium driver documentation to see which driver versions support this command.