xhprof安装和使用
来源:互联网 发布:单片机isp是什么意思 编辑:程序博客网 时间:2024/06/07 00:40
XHProf的一些特性:
1、效果图. 提供函数级的汇总信息,比如调用次数、执行时间、内存使用、CPU占用等。
2. 安装
下载对应的dll,拷贝到ext下。
http://www.xhprof.com/
</pre><p>修改php.ini</p><p><pre name="code" class="php">extension=php_xhprof.dll
xhprof.output_dir = "D:/Apache2/htdocs/xhprof_log"
3.使用
下载对应的包(地址同上http://www.xhprof.com/)
以项目的形式安装在htdocs下。
另外建立一个log目录,xhprof_log,放在htdocs下。
4.测试
在htdocs下xhprof下建立test.php,代码如下
<?php function bar($x) { if ($x > 0) { bar($x - 1); } } function foo() { for ($idx = 0; $idx < 2; $idx++) { bar($idx); $x = strlen("abc"); } } xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY); foo(); $xhprof_data = xhprof_disable(); // // Saving the XHProf run // using the default implementation of iXHProfRuns. // include_once "xhprof_lib/utils/xhprof_lib.php"; include_once "xhprof_lib/utils/xhprof_runs.php"; $xhprof_runs = new XHProfRuns_Default(); // Save the run under a namespace "xhprof_foo". // // **NOTE**: // By default save_run() will automatically generate a unique // run id for you. [You can override that behavior by passing // a run id (optional arg) to the save_run() method instead.] // $run_id = $xhprof_runs->save_run($xhprof_data, "xhprof_foo"); echo "---------------\n". "Assuming you have set up the http based UI for \n". "XHProf at some address, you can view run at \n". "http://<xhprof-ui-address>/index.php?run=$run_id&source=xhprof_foo\n". "---------------\n"; ?>
5.ending......
0 0
- xhprof安装和使用
- 安装和使用Xhprof
- xhprof安装和使用
- xhprof安装和使用
- PHP安装和使用xhprof
- linux下XHProf的安装和使用
- php调试工具---xhprof安装和使用
- xhprof扩展的安装和简单使用
- XHProf安装使用笔记
- XHProf安装使用笔记
- XHProf安装使用笔记
- XHProf安装使用笔记
- xhprof安装&&使用
- XHProf安装使用笔记
- xhprof安装&&使用
- xhprof 安装与使用
- xhprof安装&&使用
- xhprof安装&&使用
- Java变量类型识别的3种方式
- Oracle 数据库安装要点总结
- 用EDIUS去掉视频中的水印的方法
- Git vs SVN
- Python类方法和静态方法
- xhprof安装和使用
- 第八周项目3-顺序串算法
- 第12章 并发编程
- 目录values下xml文件:TypeArray、attrs、styles、colors、strings、dimens
- ftp 协议和 http 协议是如何实现的?
- Centos7 开放端口
- Express入门
- jquery的格式
- Universal-Image-Loader,android-Volley,Picasso、Fresco和Glide五大Android开源组件加载网络图片的优缺点比较