Vitals start (FR)
Perfecto Command
mobile:monitor:start
Purpose
Starts collecting part or all of the real-time vitals data generated by the device until the Vitals stop command is invoked or the script ends. The collected information helps determine how efficient an application is at using resources as well as measuring the general device performance.
Application vitals
It is also possible to collect application-specific vital measurements from mobile devices. Vitals will be separately collected for all of the selected services.
Available application vitals:
- For Android: Memory Used, CPU Used, and CPU Kernel. CPU vitals are only supported for Android for 7 and earlier.
- For iOS (8.0 and up): Memory Used, and CPU Total.
Vitals in automation and interactive
The Vitals start function performs the same operation as the Vitals feature in Interactive.
Important information when working with Automation and Interactive simultaneously:
- Starting and stopping the vitals collection in Automation will not affect Interactive
- Stopping the vitals collection in Interactive will stop the vitals collection in Automation
- Running an Automation script with vitals collection will display the vitals in Interactive
- Interactive and Automation will produce separate .csv files
A single, multiple or all vitals can be stopped at any point within the script.
Parameters
Name |
Type |
Possible Values |
Description |
---|---|---|---|
sources |
String |
|
The sources to collect vitals from. Vitals will be separately collected for all of the selected services. Device [Application name] |
interval |
Integer |
|
The data collection frequency, in seconds. Recommended between 10 and 30. Default - 1 (every second) |
monitors |
String |
all | outputs.monitors.memory.used | |
The Vitals to collect. All (default) Memory Used - Used memory Memory Cache - RAM memory that holds frequently used data Memory Free - Unused memory CPU User - Percentage usage of the CPU by the application CPU Kernel - Percentage usage of the CPU by the operating system CPU Total - Total CPU usage Bytes Out - data - Bytes sent to the mobile network Bytes In - data - Bytes received from the mobile network Bytes Out - wifi - Bytes sent to wireless network Bytes In - wifi - Bytes received from the wireless network Bytes In - total - Bytes received by the device/app |
Return Value
Json formatted data table with vitals measurements
Exceptions
None
Examples
Java sample
Map<String, Object> params = new HashMap<>();
params.put("sources", "Device");
params.put("interval", 15);
driver.executeScript("mobile:monitor:start", params);
C# sample
Dictionary<String, Object> pars = new Dictionary<String, Object>();
pars.Add("sources", "Device");
pars.Add("interval", 15);
driver.ExecuteScript("mobile:monitor:start", pars);