xhprof
#官网下载http://pecl.php.net/package/xhproftar zxf xhprof-0.9.2.tgzcd xhprof-0.9.2/extension/sudo phpize./configure --with-php-config=/usr/local/php/bin/php-configsudo makesudo make install#php.ini[xhprof]extension=xhprof.so;; directory used by default implementation of the iXHProfRuns; interface (namely, the XHProfRuns_Default class) for storing; XHProf runs.;;xhprof.output_dir=<directory_for_storing_xhprof_runs>xhprof.output_dir=/tmp/xhprof |
php中的代码:
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY);/** monitor begin */include 'common.php';$host = '127.0.0.1';$port = 11216;$objMc = new Memcache();$objMc->addServer( $host,$port,true,1,1,15,true );$key = 'test';$value = file_get_contents( 'b.js' );$str = md5( $value );dump( $str );$objMc->set( $key,$value ); md5(base64_encode(pack('N6', mt_rand(), mt_rand(), mt_rand(), mt_rand(), mt_rand(), uniqid())));$rs = $objMc->get( $key );dump( md5( $rs ) );dump($rs) ;$data = xhprof_disable();include_once "xhprof_lib/utils/xhprof_lib.php"; include_once "xhprof_lib/utils/xhprof_runs.php"; $objXhprofRun = new XHProfRuns_Default();$run_id = $objXhprofRun->save_run($data, 'memcache');/** monitor end */dump( $run_id );exit; |
xhprof的更多相关文章
- PHP性能测试工具xhprof安装与使用
原文链接:http://www.orlion.ga/711/ 一.安装 wget https://pecl.php.net/get/xhprof-0.9.4.tgz tar zxf xhprof-0. ...
- windows配置xhprof,PHP性能分析工具
本来以为配置这么一个工具不会费很大的力气,后面发现完全不是. 一.小插曲 早上显示电脑不能显示虚拟目录下的所有域名,但是能打开localhost,数据库连接也不行了.这个问题纠缠了我一个上午.对了还有 ...
- 使用xhprof分析php代码性能
推荐在Linux平台使用xhprof,win下xhprof目前稳定版本在php5.5 安装xhprof 下载地址 http://pecl.php.net/get/xhprof-0.9.4.tgz 与p ...
- PHP - xhprof+Graphviz 安装配置
简介:XHProf是Facebook放出的轻量级调试工具.和Xdebug相比,XHProf更加易用和可控,尤其是生成流程图和调试数据对比的功能很好很强大. 参考:http://us2.php.net/ ...
- XHPROF相关内容
定义入口文件 define('XHPROF_OPEN', 0); define('XHPROF_ROOT', '/home/www/xhprof/'); // 开启调试模式 建议开发阶段开启 部署阶段 ...
- PHP性能监测的工具介绍 - XHProf
http://segmentfault.com/a/1190000003509917 http://www.cnblogs.com/casatwy/archive/2013/01/17/2865241 ...
- XHProf中文手册
目录 导言 XHProf 概况 安装XHProf扩展 使用XHProf进行性能分析 设置XHProf用户界面 在生产环境中使用XHProf注意事项 轻量级采样模式 附加功能 信赖 鸣谢 导言 XHPr ...
- xhprof学习笔记
一.简介 XHProf 是一个轻量级的分层性能测量分析器. 在数据收集阶段,它跟踪调用次数与测量数据,展示程序动态调用的弧线图. 它在报告.后期处理阶段计算了独占的性能度量,例如运行经过的时间.CPU ...
- [PHP] Xhprof 非侵入式使用指南
一般使用 Xhprof ,按文档操作可以快速上手,文件头开启 Xhprof,应用结束处得到访问的url查看. 这种使用方式可以快速看到效果,同时也有一些不好的地方: 一是不利于重复利用写好的示例代码: ...
- PHP使用XHProf进行性能分析
1. 编译安装 wget http://pecl.php.net/get/xhprof-0.9.3.tgz tar zxvf xhprof-0.9.3.tgz cd xhprof-0.9.3/exte ...
随机推荐
- Dreamweaver PHP代码护眼配色方案
结果展示 [1]主菜单选择编辑->首选项.在分类中选择"字体".设置代码视图的字体为Courier New [2]在分类中选择 "代码颜色",点击 &qu ...
- 设计模式六大原则——迪米特法则(LoD)
1.背景 在图书馆借书.刚開始的时候,直接跑到对应的楼层去,到里面去转,去找要借的书,在里面溜达半天才干找到:后来知道图书馆有一个电脑查询处.然后直接在电脑上输入想要借的书,电脑就会显示你想要借的书的 ...
- 【Leetcode】Same Tree
给定两棵二叉树,判断是否相等(即树的结构以及各结点中的值都一样) Given two binary trees, write a function to check if they are equal ...
- JAVA-反射-getGenericSuperclass()
1 public class Person<T> { 2 3 } 4 5 import java.lang.reflect.ParameterizedType; 6 import java ...
- C#扩展方法的理解 (转)
“扩展方法使您能够向现有类型“添加”方法,而无需创建新的派生类型.重新编译或以其他方式修改原始类型.” 这是msdn上说的,也就是你可以对String,Int,DataRow,DataTable等这些 ...
- Python核心编程读笔 8: 文件和输入输出
第九章 文件和输入输出 一.文件内建函数.方法.属性 1 文件内建函数 file_object = open(file_name, access_mode='r', buffering=-1) 工厂函 ...
- Struts2问题,已解决No result defined for action and result input
struts2.1.8 必须在struts.xml中配置namespace属性 如果你在2.0中一切OK,但是在2.1中确出现了No result defined for action的异常,就是在因 ...
- 用CSS3绘制图形
参考资料:http://blog.csdn.net/fense_520/article/details/37892507 本文非转载,为个人原创,转载请先联系博主,谢谢~ 准备: <!DOCTY ...
- ios jsbrige
<!doctype html> <html> <head> <meta charset="utf-8"> <title> ...
- ajax、form提交乱码
ajax 传参乱码:encodeURI(encodeURI(username)) form 传参乱码:request.setCharacterEncoding("UTF-8"); ...