Hprof is an open source PHP lightweight performance analysis tool for Facebook, similar to Xdebug, but with lower performance overhead, can also be used in production environments or controlled by program switches. Based on Browse
The Performance analysis user interface of the device is easier to view or share results with peers. The call graph can also be drawn. During the data collection phase, it records the number of calls to trace and the inclusive indicator arcs in a dynamic CallGraph program.
It is unique to the reporting/post-processing phase of the data calculation. At data collection, XHPROFD handles recursive function calls by detecting loops and avoids the dead loop by invoking a useful name for each depth in the recursive call.
Xhprof's lightweight nature and aggregation capabilities make it ideal for collecting statistics on performance statistics for "production environments".
1. Installing Xhprof
wget http://pecl.php.net/get/xhprof-0.9.2.tgztar zxf xhprof-0.9.2.tgzcd xhprof-0.9.2cp-r xhprof_html Xhprof_lib < DIRECTORY_FOR_HTDOCS>CD Extensionphpize./configuremakemake Install
2. Configuring the php.ini File
[Xhprof]extension=xhprof.so;; Directory used by default implementation of the Ixhprofruns; Interface (namely, the Xhprofruns_default Class) for storing; Xhprof runs.; Remember <directory_for_storing_xhprof_runs>web to have write permission Xhprof.output_dir=<directory_for_storing_xhprof_runs >
Restart the service for the changes to take effect, you can now use Xhprof, but in order to show more dazzling, it is best to continue to install Graphviz.
3. Installing Graphviz
wget http://www.graphviz.org/pub/graphviz/stable/SOURCES/graphviz-2.26.3.tar.gz tar zxf graphviz-2.26.3.tar.gz CD graphviz-2.26.3./configuremake make Install
After the installation is complete, the/usr/local/bin/dot file is generated and you should make sure that the path is in the PATH environment variable so that xhprof can find it.
4. Apply Xhprof
PHP Performance analysis tool xhprof installation use tutorial