View Full Callgraph

需要安装

yum install -y graphviz


生产环境优化处理:

if (mt_rand(1, 10000) == 1) {

xhprof_enable(XHPROF_FLAGS_MEMORY);

register_shutdown_function(create_function('', '

$data = xhprof_disable();

$objXhprofRun = new XHProfRuns_Default();

$run_id = $objXhprofRun->save_run($data, "xhprof");

'));

}




Inclusive Time 包括子函数所有执行时间。

Exclusive Time/Self Time 函数执行本身花费的时间,不包括子树执行时间。

Wall Time 花去了的时间或挂钟时间。

CPU Time 用户耗的时间+内核耗的时间

Inclusive CPU 包括子函数一起所占用的

CPUExclusive CPU 函数自身所占用的CPU

参考:http://www.cnblogs.com/bluefrog/archive/2012/03/01/2374922.html