App profiling
Mobitru provides base functionality for monitoring the Application and Device performance.
It means you can record the Performance state and download it anytime during a Device Session.
The App profiling is available for iOS and Android but with differences in output statistics format.
Metrics
In case if App profiling is started, the following metrics will be captured
- Android:
- device:
- CPU – percent of the CPU usage
- Memory – metrics related to the Device memory usage (total, used, free, shared, etc.)
- app:
- CPU – metrics related to CPU usage time and threads (time, stime, threads, etc.)
- Memory – extended statistic for current memory consumption (java/native Heap, code, stack graphics, etc.)
- Graphics – information about screen rendering and data displaying (fps, totalFramesRendered, slowUIThread, etc.)
- device:
- iOS:
- device:
- CPU – an indicator of CPU usage
- Memory – a couple of metrics for free and used memory
- FPS – current FPS value on the Device
- app:
- CPU – percent of CPU usage and threads
- Memory – app memory usage indicator
- device:
- Also, every group of metrics contains the ts field, which is the current timestamp from the beginning of a Profiling session
Run the Profiling
The metrics capturing can be started when an Application is installed and started on a Device.
It can performed manually or from autotests.
Step 1: Start profiling
For now, it can be performed only via REST API and only requires the app package name with the device UDID.
Here is an example cURL
request to start profiling:
curl --location 'https://app.mobitru.com/billing/unit/<BILLING_UNIT>/automation/api/device/<DEVICE_UDID>/profiler' \
--header 'Authorization: Bearer <ACCESS_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"appPackage": "<APP_PACKAGE_NAME>"
}'
As a result, you will receive 201 Created response.
Step 2: Stop profiling
At the end of the Device session, you can stop the Profiling by another REST API, which only requires the device UDID.
Here is an example cURL
request to stop profiling:
curl --location --request DELETE 'https://stage.mobitru.com/billing/unit/epm-tstf/automation/api/device/<DEVICE_UDID>/profiler' \
--header 'Authorization: Bearer <ACCESS_KEY>' \
--header 'Content-Type: application/json'
As a result, you will receive recording data in JSON format.
{
"info": {
"app": "<APP_PACKAGE>",
"device": {
"serial": "<UDID>",
"model": "SM-T870",
"version": "12",
"abi": "arm64-v8a",
"sdk": "32",
"product": "gts7lwifiser",
"deviceType": "tablet",
"buildId": "SP2A.220305.013"
}
},
"deviceCpu": [
{
"usagePercent": 11,
"ts": 2.057
},
{
"usagePercent": 19,
"ts": 4.097
},
...
],
"deviceMemory": [
{
"total": 5923065856,
"used": 5721358336,
"free": 201707520,
"shared": 21196800,
"buffers": 4005888,
"ts": 2.069
},
{
"total": 5923065856,
"used": 5728780288,
"free": 194285568,
"shared": 21491712,
"buffers": 4005888,
"ts": 4.1
},
...
],
"appCpu": [
{
"utime": 62,
"stime": 12,
"usagePercent": 11,
"threads": 25,
"ts": 2.067
},
{
"utime": 128,
"stime": 27,
"usagePercent": 41,
"threads": 30,
"ts": 4.098
},
...
],
"appMemory": [
{
"javaHeap": 34628,
"nativeHeap": 13908,
"code": 109900,
"stack": 744,
"graphics": 65404,
"privateOther": 3524,
"system": 8706,
"ts": 2.221
},
{
"javaHeap": 38528,
"nativeHeap": 18800,
"code": 113704,
"stack": 1060,
"graphics": 67388,
"privateOther": 3876,
"system": 9784,
"ts": 4.353
},
...
],
"appGfxInfo": [
{
"fps": -322,
"totalFramesRendered": 4,
"jankyFrames": 3,
"_50PercentileMs": 105,
"_90PercentileMs": 105,
"_95PercentileMs": 105,
"_99PercentileMs": 105,
"missedVsync": 2,
"highInputLatency": 1,
"slowUIThread": 2,
"slowBitmapUploads": 0,
"slowIssueDrawCommands": 1,
"frameDeadlineMissed": 3,
"ts": 2.09
},
{
"fps": 38,
"totalFramesRendered": 90,
"jankyFrames": 6,
"_50PercentileMs": 5,
"_90PercentileMs": 9,
"_95PercentileMs": 34,
"_99PercentileMs": 105,
"missedVsync": 4,
"highInputLatency": 168,
"slowUIThread": 5,
"slowBitmapUploads": 0,
"slowIssueDrawCommands": 4,
"frameDeadlineMissed": 6,
"ts": 4.358
},
...
]
}
Limitations
- Usage data can be received only once at the end of Profiling
- Start/stop profiling can be performed via API only
- In case of parallel execution, the Data will be provided for every device separately