SlideShare una empresa de Scribd logo
1 de 19
PHP 性能检测扩展—— XHProf ,[object Object]
[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object]
[object Object]
[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
# wget http://pecl.php.net/get/xhprof-0.9.2.tgz # tar zxf xhprof-0.9.2.tgz # cd xhprof-0.9.2 # cp -r xhprof_html xhprof_lib /var/www/www.test.com/ # cd extension/ # /usr/local/php/bin/phpize # ./configure  –with-php-config=/usr/local/php/bin/php-config # make && make install ,[object Object],[xhprof]  extension="/usr/local/php/lib/xhprof.so" xhprof.output_dir=/var/www/xhprof
# wget http://www.graphviz.org/pub/graphviz/stable/SOURCES/graphviz-2.24.0.tar.gz # tar zxf graphviz-2.24.0.tar.gz # cd graphviz-2.24.0 # ./configure # make && make install ,[object Object]
[object Object]
[object Object]
[object Object],[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object],屏蔽函数
[object Object]
[object Object],一、数据结构可以根据需要定义存储方式 二、分析界面 PHP 代码可以根据需要重写 三、数据可以进行对比( diff 报告),汇总分析(汇总报告) 四、 CPU 的计时器是粗粒度的,毫秒精度,对性能消耗大,误差大 五、 XHProf 支持采样设置 六、可以在 PHP 上做抽样 if (mt_rand(1, 10000) == 1) { xhprof_enable(XHPROF_FLAGS_MEMORY); $xhprof_on = true; } request 结束时 ( 或是在退出函数中 )  ,您可以这么做: if ($xhprof_on) { // stop profiler $xhprof_data = xhprof_disable(); // save $xhprof_data somewhere (say a central DB) ... }
[object Object],[object Object],[object Object],[object Object]

Más contenido relacionado

Similar a Php性能检测扩展——xh prof

Phpconf 2011 introduction_to_codeigniter
Phpconf 2011 introduction_to_codeigniterPhpconf 2011 introduction_to_codeigniter
Phpconf 2011 introduction_to_codeigniterBo-Yi Wu
 
信息系统开发平台OpenExpressApp
信息系统开发平台OpenExpressApp信息系统开发平台OpenExpressApp
信息系统开发平台OpenExpressAppzhoujg
 
Ajax Lucence
Ajax LucenceAjax Lucence
Ajax LucenceRoger Xia
 
漫谈php和java
漫谈php和java漫谈php和java
漫谈php和javasulong
 
Php设计模式介绍
Php设计模式介绍Php设计模式介绍
Php设计模式介绍cyf5513
 
Real World ASP.NET MVC
Real World ASP.NET MVCReal World ASP.NET MVC
Real World ASP.NET MVCjeffz
 
如何使用 Xhprof 分析網站效能 (真實案例2)
如何使用 Xhprof 分析網站效能 (真實案例2)如何使用 Xhprof 分析網站效能 (真實案例2)
如何使用 Xhprof 分析網站效能 (真實案例2)Cyril Wang
 
Think php 1.0.0rc1开发人员指南
Think php 1.0.0rc1开发人员指南Think php 1.0.0rc1开发人员指南
Think php 1.0.0rc1开发人员指南Ashim Thapa
 
Phalcon the fastest php framework 阿土伯
Phalcon   the fastest php framework 阿土伯Phalcon   the fastest php framework 阿土伯
Phalcon the fastest php framework 阿土伯Hash Lin
 
Phalcon phpconftw2012
Phalcon phpconftw2012Phalcon phpconftw2012
Phalcon phpconftw2012Rack Lin
 
Django敏捷开发 刘天斯
Django敏捷开发 刘天斯Django敏捷开发 刘天斯
Django敏捷开发 刘天斯liuts
 
Php documentor
Php documentorPhp documentor
Php documentorCloud Liao
 
Php documentor
Php documentorPhp documentor
Php documentorCloud Liao
 
构建基于Lamp的网站架构
构建基于Lamp的网站架构构建基于Lamp的网站架构
构建基于Lamp的网站架构Cosey Lee
 
常用开发工具介绍
常用开发工具介绍常用开发工具介绍
常用开发工具介绍haozes
 
Introduction To Direct Show
Introduction To Direct ShowIntroduction To Direct Show
Introduction To Direct Showguestce3937
 
Introduction To Direct Show
Introduction To  Direct ShowIntroduction To  Direct Show
Introduction To Direct Showguestce3937
 
2006 recycle opensourceprojects
2006 recycle opensourceprojects2006 recycle opensourceprojects
2006 recycle opensourceprojectsGeorge Ang
 
Recycle Open Source Projects
Recycle Open Source ProjectsRecycle Open Source Projects
Recycle Open Source ProjectsGeorge Ang
 

Similar a Php性能检测扩展——xh prof (20)

Phpconf 2011 introduction_to_codeigniter
Phpconf 2011 introduction_to_codeigniterPhpconf 2011 introduction_to_codeigniter
Phpconf 2011 introduction_to_codeigniter
 
信息系统开发平台OpenExpressApp
信息系统开发平台OpenExpressApp信息系统开发平台OpenExpressApp
信息系统开发平台OpenExpressApp
 
Ajax Lucence
Ajax LucenceAjax Lucence
Ajax Lucence
 
漫谈php和java
漫谈php和java漫谈php和java
漫谈php和java
 
Php设计模式介绍
Php设计模式介绍Php设计模式介绍
Php设计模式介绍
 
Real World ASP.NET MVC
Real World ASP.NET MVCReal World ASP.NET MVC
Real World ASP.NET MVC
 
如何使用 Xhprof 分析網站效能 (真實案例2)
如何使用 Xhprof 分析網站效能 (真實案例2)如何使用 Xhprof 分析網站效能 (真實案例2)
如何使用 Xhprof 分析網站效能 (真實案例2)
 
Think php 1.0.0rc1开发人员指南
Think php 1.0.0rc1开发人员指南Think php 1.0.0rc1开发人员指南
Think php 1.0.0rc1开发人员指南
 
Berserk js
Berserk jsBerserk js
Berserk js
 
Phalcon the fastest php framework 阿土伯
Phalcon   the fastest php framework 阿土伯Phalcon   the fastest php framework 阿土伯
Phalcon the fastest php framework 阿土伯
 
Phalcon phpconftw2012
Phalcon phpconftw2012Phalcon phpconftw2012
Phalcon phpconftw2012
 
Django敏捷开发 刘天斯
Django敏捷开发 刘天斯Django敏捷开发 刘天斯
Django敏捷开发 刘天斯
 
Php documentor
Php documentorPhp documentor
Php documentor
 
Php documentor
Php documentorPhp documentor
Php documentor
 
构建基于Lamp的网站架构
构建基于Lamp的网站架构构建基于Lamp的网站架构
构建基于Lamp的网站架构
 
常用开发工具介绍
常用开发工具介绍常用开发工具介绍
常用开发工具介绍
 
Introduction To Direct Show
Introduction To Direct ShowIntroduction To Direct Show
Introduction To Direct Show
 
Introduction To Direct Show
Introduction To  Direct ShowIntroduction To  Direct Show
Introduction To Direct Show
 
2006 recycle opensourceprojects
2006 recycle opensourceprojects2006 recycle opensourceprojects
2006 recycle opensourceprojects
 
Recycle Open Source Projects
Recycle Open Source ProjectsRecycle Open Source Projects
Recycle Open Source Projects
 

Php性能检测扩展——xh prof

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.