顾名思义,xhprof gui 就是一个xhprof的一个ui展现。作者hack了facebook发布的xhprof展现代码。使xhprof界面更漂亮,功能更强大。
xhprof gui新增了如下特性:
* 友好的界面
* 数据库存储(mysql)
* 支持按请求百分比执行xhprof优化。降低服务器负载。
* 支持相似url的概念。如:http://news.example.com/?story=23 http://news.example.com/?story=25 被视为相似url。 完整的特性请查看 http://blog.preinheimer.com/index.php?/archives/355-A-GUI-for-XHProf.html
安装步骤如下:
1.安装zlib扩展
windows下php默认是安装了zlib扩展的。非windows,需要自己编译扩展。扩展代码在php源码的ext/zlib目录中。如何编译扩展,就不再这里啰嗦了。
2.安装xhprof扩展
在所有需要用xhprof进行打点优化的机器上都安装xhprof的php扩展。
3.安装 graphviz
xhprof gui 使用graphviz 进行画图。
sudo yum install graphviz graphviz-gd
4.安装xhprof gui
在所有需要用xhprof打点的机器和展现打点数据的机器上都需要安装xhprof gui.
下载地址 https://github.com/preinheimer/xhprof
安装步骤见代码中的INSTALL文件。
需要注意的是,配置文件中没有填写mysql端口的地方。如果你的数据库不是使用的默认端口,你需要修改 ./xhprof_lib/utils/Db/ 相应文件的代码。
技术交流
原文链接:xhprof gui,让xhprof界面更漂亮,功能更强大,转载请注明来源!
你好,我的编译时报错 怎么回事/bin/sh /home/soft/xhprof/extension/libtool --mode=compile cc -I. -I/home/soft/xhprof/extension -DPHP_ATOM_INC -I/home/soft/xhprof/extension/include -I/home/soft/xhprof/extension/main -I/home/soft/xhprof/extension -I/usr/local/php5/include/php -I/usr/local/php5/include/php/main -I/usr/local/php5/include/php/TSRM -I/usr/local/php5/include/php/Zend -I/usr/local/php5/include/php/ext -I/usr/local/php5/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home/soft/xhprof/extension/xhprof.c -o xhprof.lo mkdir .libs cc -I. -I/home/soft/xhprof/extension -DPHP_ATOM_INC -I/home/soft/xhprof/extension/include -I/home/soft/xhprof/extension/main -I/home/soft/xhprof/extension -I/usr/local/php5/include/php -I/usr/local/php5/include/php/main -I/usr/local/php5/include/php/TSRM -I/usr/local/php5/include/php/Zend -I/usr/local/php5/include/php/ext -I/usr/local/php5/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home/soft/xhprof/extension/xhprof.c -fPIC -DPIC -o .libs/xhprof.o/home/soft/xhprof/extension/xhprof.c: In function ‘hp_get_function_name’:/home/soft/xhprof/extension/xhprof.c:972: warning: assignment discards qualifiers from pointer target type/home/soft/xhprof/extension/xhprof.c:1042: warning: passing argument 1 of ‘hp_get_base_filename’ discards qualifiers from pointer target type/home/soft/xhprof/extension/xhprof.c:926: note: expected ‘char *’ but argument is of type ‘const char *’/home/soft/xhprof/extension/xhprof.c: In function ‘hp_execute_internal’:/home/soft/xhprof/extension/xhprof.c:1741: error: ‘zend_execute_data’ has no member named ‘Ts’/home/soft/xhprof/extension/xhprof.c: In function ‘hp_compile_file’:/home/soft/xhprof/extension/xhprof.c:1785: warning: passing argument 1 of ‘hp_get_base_filename’ discards qualifiers from pointer target type/home/soft/xhprof/extension/xhprof.c:926: note: expected ‘char *’ but argument is of type ‘const char *’/home/soft/xhprof/extension/xhprof.c: In function ‘hp_begin’:/home/soft/xhprof/extension/xhprof.c:1853: error: lvalue required as left operand of assignment/home/soft/xhprof/extension/xhprof.c:1856: warning: assignment from incompatible pointer type/home/soft/xhprof/extension/xhprof.c:1861: warning: assignment from incompatible pointer type/home/soft/xhprof/extension/xhprof.c: In function ‘hp_stop’:/home/soft/xhprof/extension/xhprof.c:1926: error: lvalue required as left operand of assignment/home/soft/xhprof/extension/xhprof.c:1927: warning: assignment from incompatible pointer typemake: *** [xhprof.lo] Error 1