简体   繁体   English

使用XCode Instruments分析OS X上的CPU或内存使用情况,还有其他可能性吗?

[英]Analyze CPU or Memory Usage on OS X with XCode Instruments, other possibilities?

I´m using XCode Instruments for a analysis of my system performance usage of cpu and memory . 我正在使用XCode Instruments分析我的CPU内存的系统性能使用情况。

When I record the usage, especially for "2 minutes" , I got "120" (2min x 60sec, 1 value every second) values of cpu/memory usage of each process. 当我记录使用情况时,尤其是在“ 2分钟”中 ,我获得了每个进程的cpu /内存使用情况值“ 120” (2min x 60sec,每秒1个值)。 Is it possible to get a average value for each process about his "120" values of cpu/memory usage? 是否有可能为每个进程获取有关其CPU /内存使用量“ 120”值的平均值? XCode Instruments save the logs in a .trace file, is it possible to save the logs in a text file to get all values in a human readable file? XCode Instruments将日志保存在.trace文件中,是否可以将日志保存在文本文件中以将所有值保存在人类可读的文件中?

Is there a other way to solve my problem? 还有其他方法可以解决我的问题吗? Maybe with a python script ? 也许用python脚本

All I want is an average percent value of cpu and memory usage of a selected process in a time interval . 我想要的只是一个time interval选定进程的cpu内存使用率的平均百分比值。 For example I´m using Google Chrome for "10" minutes, now I want a average percent value of cpu and memory usage in this "10" minutes. 例如,我使用Google Chrome浏览器的时间为“ 10”分钟,现在我希望在这“ 10”分钟内平均获得cpu内存使用率的百分比百分比。

I can answer your question about saving the logs. 我可以回答您有关保存日志的问题。 Some instruments let you export the trace data to CSV format. 一些仪器可让您将跟踪数据导出为CSV格式。 Select an instrument from your trace (there's a list of instruments on the left side of the trace window) and choose Instrument > Export Track. 从跟踪中选择一种仪器(跟踪窗口左侧有一系列仪器),然后选择“仪器”>“导出跟踪”。 If this menu item is disabled for a particular instrument, it means that instrument can't export its data to CSV. 如果为特定仪器禁用了此菜单项,则意味着该仪器无法将其数据导出到CSV。

I don't have an answer to your question on getting the average value of CPU and memory usage. 对于您获取CPU和内存使用率平均值的问题,我没有答案。 But I can tell you that Instruments has the Time Profiler instrument to track the CPU usage of an application and the Allocations instrument to track the memory usage of an application. 但我可以告诉您,Instruments有Time Profiler工具来跟踪应用程序的CPU使用情况,而Allocations工具有跟踪应用程序的内存使用情况。 Using those instruments should give you a better measure of how much CPU and memory your application is using. 使用这些工具应该可以更好地衡量应用程序正在使用多少CPU和内存。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM