Giter Club home page Giter Club logo

phpng-xhprof's Introduction

Xhprof of PHP7

XHProf is a function-level hierarchical profiler for PHP and has a simple HTML based navigational interface. The raw data collection component is implemented in C (as a PHP extension). The reporting/UI layer is all in PHP.

It is capable of reporting function-level inclusive and exclusive wall times, memory usage, CPU times and number of calls for each function.

Additionally, it supports ability to compare two runs (hierarchical DIFF reports), or aggregate results from multiple runs.

You can visit http://pecl.php.net/package/xhprof to find the official extension.

But never find the version of PHP7, So I tried.

Installation

git clone [email protected]:Yaoguais/phpng-xhprof.git ./xhprof
cd xhprof
phpize
./configure
make clean && make && make test && sudo make install

Then add the configuration into php.ini

[xhprof]
extension = phpng_xhprof.so
xhprof.output_dir = /tmp/xhprof

If you compiled PHP7 from source code, then

git clone [email protected]:Yaoguais/phpng-xhprof.git ./xhprof
cd xhprof
/path/to/php7/bin/phpize
./configure --with-php-config=/path/to/php7/bin/php-config
make clean && make && make test && sudo make install

Test

There are 12 test cases, the extension by 11, and the rest can not be due to the result of the PHP core, which is call_user_function family of functions.

You can use "make test" command to test the extension, and there are also simple test examples.

/path/to/php7/bin/php diff/enable.php
ls -l diff

Notice

This extension replaces the PHP core, so when you use other extensions like xdebug or phpdbg, which might be impaired.

You should add the phpng-xhprof configuration options to the php.ini of the bottom, and this is due to PHP 's startup sequence resulting from extension.

Licence

Apache License Version 2.0.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.