xhProf使用注意点
2015-10-07 17:04
399 查看
例子:
1.配置代码:
//测试开始配置代码
xhprof_enable(XHPROF_FLAGS_CPU+ XHPROF_FLAGS_MEMORY);
//测试的代码块开始
$this->view->datas= $this->objCrudpcapp->search($this->postData);
$this->view->postData['PGC']=1;
//测试的代码块结束
//结束代码块开始
$xhprof_data =xhprof_disable();
include_once(Z_ENV_HTDOCS."/xhprof_lib/utils/xhprof_lib.php");
include_once(Z_ENV_HTDOCS."/xhprof_lib/utils/xhprof_runs.php");
//include_once(Z_WEB_ROOT."/xhprof_lib/utils/xhprof_lib.php");
//include_once(Z_WEB_ROOT."/xhprof_lib/utils/xhprof_runs.php");
$objXhprofRun = newXHProfRuns_Default();
$run_id =$objXhprofRun->save_run($xhprof_data, "xhprof_pc");
echo "<ahref='/xhprof_html/index.php?run=".$run_id."&source=xhprof_pc'target='_blank'>view</a>";
//结束代码块结尾
2.打开生成log的链接
xhprof
http://localhost/xhprof_html/index.php?run=53202d4ae920d&source=xhprof
3.报告查看参照以下链接:
http://www.ec-os.net/misc/xhprof.html
(1).
查看单个报告。
# 我们想要查看 4b4c239a86593.xhprof
这个报告的详细信息,查看链接如下:
http://host/xhprof_html/index.php?run=4b4c239a86593&source=xhprof
(2).
比较两个报告。
# 我们想比较 4b4c239a86593.xhprof
和4b4c2645794f0.xhprof
两个报告,查看链接如下:
http://host/xhprof_html/index.php?run1=4b4c239a86593&run2=4b4c2645794f0&source=xhprof
我们可以看到精确到函数级的分析数据,包括调用次数、CPU、内存等,还可以不断的向下跟踪。
1.配置代码:
//测试开始配置代码
xhprof_enable(XHPROF_FLAGS_CPU+ XHPROF_FLAGS_MEMORY);
//测试的代码块开始
$this->view->datas= $this->objCrudpcapp->search($this->postData);
$this->view->postData['PGC']=1;
//测试的代码块结束
//结束代码块开始
$xhprof_data =xhprof_disable();
include_once(Z_ENV_HTDOCS."/xhprof_lib/utils/xhprof_lib.php");
include_once(Z_ENV_HTDOCS."/xhprof_lib/utils/xhprof_runs.php");
//include_once(Z_WEB_ROOT."/xhprof_lib/utils/xhprof_lib.php");
//include_once(Z_WEB_ROOT."/xhprof_lib/utils/xhprof_runs.php");
$objXhprofRun = newXHProfRuns_Default();
$run_id =$objXhprofRun->save_run($xhprof_data, "xhprof_pc");
echo "<ahref='/xhprof_html/index.php?run=".$run_id."&source=xhprof_pc'target='_blank'>view</a>";
//结束代码块结尾
2.打开生成log的链接
xhprof
http://localhost/xhprof_html/index.php?run=53202d4ae920d&source=xhprof
3.报告查看参照以下链接:
http://www.ec-os.net/misc/xhprof.html
(1).
查看单个报告。
# 我们想要查看 4b4c239a86593.xhprof
这个报告的详细信息,查看链接如下:
http://host/xhprof_html/index.php?run=4b4c239a86593&source=xhprof
(2).
比较两个报告。
# 我们想比较 4b4c239a86593.xhprof
和4b4c2645794f0.xhprof
两个报告,查看链接如下:
http://host/xhprof_html/index.php?run1=4b4c239a86593&run2=4b4c2645794f0&source=xhprof
我们可以看到精确到函数级的分析数据,包括调用次数、CPU、内存等,还可以不断的向下跟踪。
相关文章推荐
- Scala学习笔记06【Tuple、Array、Map、文件实战入门】
- 二叉树的遍历
- SQL Server使用问题总结
- volley(2)——自定义request
- 求出0~999之间的所有“水仙花数”并输出
- 对象在方法中进行连续的传递 —— 士兵开枪练习
- swift开发的那些应用
- Android中dp、sp、px的转换和区别。
- MySQL学习笔记(三):关键词
- RSA算法原理
- Spring <context:annotation-config/> 解说
- Volley(1)——基本使用
- Java对文件的随机读写以及压缩处理操作
- 大型网站之分布式会话管理
- python os相关操作
- UVA-127 "Accordian" Patience (模拟)
- LeetCode OJ:Happy Number(欢乐数)
- Python处理JSON
- Android QQ、微信聊天消息界面设计原理与实现
- 数据库 SQL