This is a fork of https://github.com/preinheimer/xhprof with some improvements, see below:
- Call graph is built using SVG powered by Graphviz, which runs a lot faster then PNG images, allows text search and quick zoom and pan.
- Text search on SVG
- Quick zoom and pan
- Allow expanding the graph by clicking the functions
- Improved algorithm to include all children of selected function
- Moved the code to generate the extension to a separate repo, keeping only code for GUI in this repo.
- Moved third party code and using CDN versions instead.
- Using .env files for configuration instead of php files.
- Using Docker to run the GUI, reducing dependencies and making setup easier.
- Some code refactoring and UI improvements.
- Create a copy of .env.example as .env i.e.
cp .env.example .env
- Configure anything you want, make sure the Project port used is available in your system.
- Run
make build
This command will do the following:- Start the Docker containers
- Install the Xhprof extension and dependencies
- Install the database
- To stop the containers, run
make stop
. To start again, runmake start
. - To open the GUI on your browser, run
make open
There are 4 ways of populating and viewing traces:
- Run 'make db-dummy-data' to create some dummy traces and test the UI. Run
make db-drop
to clear the database. - Open the Sample url
- Add an include for external/header.php and external/footer.php on your own PHP scripts
- Download Xhprof traces to your local computer and upload to the folder
docker/traces
. The traces will not appear automatically on the GUI, but you can open the trace on your browser using this patternhttp://127.0.0.1:8000/graphviz/?url=/api/file/%3Frun=1234
, where 1234 refers to a file nameddocker/traces/1234.xhprof
- Rewrite the code to use OOP with reusable classes
- Allow the GUI to be added to any PHP project using Composer
- Add a new button on the UI to allow importing Dumps from .xhprof files
- Add a button on the UI to allow filtering by parent functions or child functions (current)
- Bug fixes