Php性能检测扩展——xh prof

Download Php性能检测扩展——xh prof

Post on 11-Aug-2014

1.696 views

Category:

Automotive

0 download

Embed Size (px)

DESCRIPTION

PHPXHProf

TRANSCRIPT

<ul><li>PHP XHProf </li><li><ul><li> XHProf </li></ul><ul><li> XHProf </li></ul></li><li><ul><li>XHProf PHP CPU C xhprof Zend </li></ul><ul><li>XHProf facebook php Xdebug profile callgraph / XHProfd XHProf </li></ul><ul><li> XHProf </li></ul></li><li><ul><li> XHProf </li></ul></li><li><ul><li>xhprof-0.9.2.tgz </li></ul><ul><li>graphviz-2.24.0.tar.gz </li></ul><ul><li> XHProf </li></ul></li><li><ul><li> ~ </li></ul><ul><li> PHP.ini </li></ul><ul><li> PHP </li></ul><ul><li> XHProf </li></ul></li><li># 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 &amp;&amp; make install <ul><li> XHProf </li></ul>[xhprof] extension="/usr/local/php/lib/xhprof.so" xhprof.output_dir=/var/www/xhprof </li><li># 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 &amp;&amp; make install <ul><li> Graphviz </li></ul></li><li> 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) ... } </li><li><ul><li>QQ 46163020 </li></ul><ul><li>Email [email_address] </li></ul><ul><li>WEB http://yuenshui.com( ) </li></ul></li></ul>