YueChen-C / py-ios-device

IOS Professional Performance Testing Tool . You can get CPU, GPU, Memory , Lifecycle and other metrics from real iOS devices . iOS 性能测试工具
GNU General Public License v3.0
667 stars 183 forks source link

Get real-time cpu usage on iPhone 6 #115

Closed gadgadskiy closed 1 year ago

gadgadskiy commented 1 year ago

Smartphone

I'm using the following command to get CPU usage while running a specific app on different models of iPhone: pyidevice instruments sysmontap -b <my_bundle> --proc_filter cpuUsage --processes --udid <my_udid> --format flush For iPhones v7 or later, it returns adequate values. But for iPhone 6, values are unbelievably low. During the long monitoring, the biggest value was 4.59 (and most of them are in 0.5...2.5). But I can see, via Xcode, that the real percentage usage of my app is up to 40%.

What strange values are returned for iPhone 6? How to convert them to adequate percentages?

gadgadskiy commented 1 year ago

It looks like the biggest possible "cpuUsage" value for this device is 5, which equals 200%. But it's just my research; I didn't find any helpful info about it. So I'm unsure if I can get the correct percentages as cpuUsage * 40.

YueChen-C commented 1 year ago

refer to

https://github.com/YueChen-C/py-ios-device/blob/3df57eef696e67f567401a8a1986397aeb48c850/ios_device/cli/instruments.py#L175

gadgadskiy commented 1 year ago

Thank, yes, that's it.