我目前正在使用由tideways.ioxhprof
分叉的库来分析执行。从, 我可以得到, ,和. 我正在尝试对 symfony 控制台进行基准测试 - 所以我添加了它和它的.myscript.php
xhprof
walltime
cputime
memoryusage
peakmemoryusage
TIDEWAYS_ENABLE()
ConsoleCommandEvent
TIDEWAYS_DISABLE
ConsoleTerminateEvent
问题:
- 我如何确定是否
myscript.php
消耗了多少百分比的cpu?我可以像在 serverfault 上cpuusage = cputime / realtime
所说的那样计算百分比吗? - 给定一个
memoryusage (mu)
和peakmemoryusage (pmu)
来自xhprof
探查器,我如何转换或计算它的ram
使用量?(top
结果显示远高于memoryusage
但不知何故接近peakmemoryusage
价值,所以我可以说ram
使用是价值peakmemoryusage
吗?
笔记:
- 这与我的 CPU 和内存使用率不同,因为我想要的不是
system load
. ps可能有多个scripts.php
同时运行。