Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: get performance data for cpu/memory/gpu/fps/network #40

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

debugtalk
Copy link

@debugtalk debugtalk commented Oct 3, 2022

新增支持 iOS 性能采集(CPU & Mem & GPU & FPS & Network)。

#37 的重新进行了实现,采集方式参考了 py-ios-device

system monitor

{"type":"sys_cpu","timestamp":1665559008,"nice_load":0,"system_load":-1,"total_load":9.980198019801975,"user_load":-1}
{"type":"sys_mem","timestamp":1665559008,"app_memory":48481,"free_memory":32947,"used_memory":143497,"wired_memory":46897,"cached_files":57381,"compressed":36411,"swap_used":13893632}
{"type":"sys_disk","timestamp":1665559008,"data_read":519033083904,"data_written":88557494272,"reads_in":32944860,"writes_out":6065372}
{"type":"sys_network","timestamp":1665559008,"bytes_in":5749220664,"bytes_out":1641764996,"packets_in":6519608,"packets_out":2494850}

process monitor

get pid 3872 by bundleId com.apple.mobilesafari
{"pid":3872,"proc_perf":{"cpuUsage":4.419134441935455,"memAnon":21905408,"pid":3872},"sys_perf":{"__vmSwapUsage":13893632,"diskBytesRead":519892711424,"diskBytesWritten":88607989760,"diskReadOps":32983419,"diskWriteOps":6068720,"netBytesIn":5751979062,"netBytesOut":1643991471,"netPacketsIn":6521832,"netPacketsOut":2496260,"vmCompressorPageCount":41474,"vmExtPageCount":66269,"vmFreeCount":1644,"vmIntPageCount":65694,"vmPurgeableCount":287,"vmUsedCount":233595,"vmWireCount":50318},"timestamp":1665559084,"type":"process"}

network details

{"type":"network-connection-detected","timestamp":1665559251,"local_address":"10.90.205.249:51577","remote_address":"180.130.120.151:443","interface_index":13,"pid":-2,"recv_buffer_size":4194240,"recv_buffer_used":70590,"serial_number":27,"kind":1}
{"type":"network-connection-detected","timestamp":1665559251,"local_address":"::fdbd:ff1:ce00:1006:1cc3:bcb9:51625","remote_address":"::2408:876c:1780:120:0:0:443","interface_index":13,"pid":-2,"recv_buffer_size":131072,"recv_buffer_used":0,"serial_number":261,"kind":1}
{"type":"network-connection-detected","timestamp":1665559251,"local_address":"::fdbd:ff1:ce00:1006:1cc3:bcb9:51626","remote_address":"0:0:240e:918:8007:::443","interface_index":13,"pid":-2,"recv_buffer_size":131072,"recv_buffer_used":0,"serial_number":262,"kind":1}
{"type":"network-connection-detected","timestamp":1665559251,"local_address":"10.90.205.249:51628","remote_address":"14.205.45.111:443","interface_index":13,"pid":-2,"recv_buffer_size":131072,"recv_buffer_used":0,"serial_number":264,"kind":1}
{"type":"network-connection-update","timestamp":1665559251,"rx_bytes":0,"rx_packets":0,"tx_bytes":0,"tx_packets":0,"connection_serial":264}
{"type":"network-connection-detected","timestamp":1665559251,"local_address":"10.90.205.249:51628","remote_address":"14.205.45.111:443","interface_index":13,"pid":-2,"recv_buffer_size":131072,"recv_buffer_used":0,"serial_number":264,"kind":1}
{"type":"network-connection-update","timestamp":1665559252,"rx_bytes":0,"rx_packets":0,"tx_bytes":0,"tx_packets":0,"connection_serial":265}
{"type":"network-connection-update","timestamp":1665559252,"rx_bytes":0,"rx_packets":0,"tx_bytes":0,"tx_packets":0,"connection_serial":266}

GPU

{"type":"gpu","timestamp":1665559137,"tiler_utilization":20,"device_utilization":20,"renderer_utilization":20}

FPS

{"type":"fps","timestamp":1665559176,"fps":59}
{"type":"fps","timestamp":1665559177,"fps":51}

aoliaoaoaojiao and others added 6 commits August 9, 2022 22:27
* 添加OpenglServer和SysmontapServer分别获取GPU/FPS/CPU/MEM相关数据

* 修复接收CPU数据uint64转换失败问题

* 添加GetPerfmon方法

* 增加获取系统网络上发/下载方法;todo GetPerfmon、iterFps、iterGPU、iterNetWork方法优化,增加单应用网络状态获取方法

* 增加單個應用網絡狀態監控

* 优化方法

* 优化输出流

* 优化方法

* 增加相关结束函数

* 增加参数类型

* 优化方法,开放CPU和MEM、系统FPS和GPU、系统networking性能数据相关方法

* 优化输出

* 优化输出

* 优化输出

* 优化输出

* 优化代码,隐藏iter方法

* 细节优化

* 优化,尝试关闭chan

* 添加性能数据对应的实体类和输出数据的方法

* 初步确定优化方式,后续继续更改

* 优化性能数据

* toString方法优化

* 优化chan关闭

* 优化无参数时异常情况、优化实体类、优化测试方法

* 1.删除perfmorance包,性能数据struct放到instruments中,里面的性能数据struct删除ToString、ToJ…son、ToFormat方法
2.隐藏StopPerfmon方法,调用GetPerfmon返回的context.CancelFunc直接关闭
3.弃用PerfMonData通道处理数据,原始性能数据统一输送到interface通道里,由用户自行决定数据的处理
4.CPU、MEM优化异常PID信息提示
5.GetPerfmon参数优化,默认展示所有性能数据
6.fix cpu、mem plist Unknown parameter

Co-authored-by: 奥利嗷嗷嗷叫 <53102695+alliaoaoo@users.noreply.github.com>
@debugtalk debugtalk changed the base branch from dev-performance-monitoring to main October 4, 2022 01:36
@debugtalk debugtalk changed the title feat: get performance data for cpu and memory feat: get performance data for cpu/memory/gpu/fps/network Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants