https://github.com/badoo/xhprof_console
A console tool for grabbing profiles from XHProf database and collecting aggregates from them
https://github.com/badoo/xhprof_console
Last synced: 9 months ago
JSON representation
A console tool for grabbing profiles from XHProf database and collecting aggregates from them
- Host: GitHub
- URL: https://github.com/badoo/xhprof_console
- Owner: badoo
- License: mit
- Created: 2018-04-06T09:32:42.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-06T16:05:18.000Z (about 8 years ago)
- Last Synced: 2025-07-04T08:41:53.068Z (12 months ago)
- Language: PHP
- Size: 4.88 KB
- Stars: 11
- Watchers: 8
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# xhprof_console
A console tool for grabbing profiles from XHProf database and collecting aggregates from them
## Requirements:
* PHP with XHProf installed and set up.
* This script works directly with xhprof database, profiles should be taken as usual.
## Why to use it instead of native XHProf interface:
It allows to collect and see stats for several XHProf profiles. Stats includes:
* average method exec time
* 90 percentile of method exec time
* min, max of the exec time
## How to use
First run xhprof_console.php with no arguments. I'll give you a config format. Copy it to config.php
Then fill the config with mysql settings and also change the SQL to select desired profiles.
Run:
php xhprof_console.php config.php
You'll see an error if something wrong. If not - the root method stats and a command prompt.
## Stats format
There are three sections:
* Self Stat - the stats of current method
* Children - the stats of method which are called by current
* Parents - the stats of method which call current method
In each sections table columns are:
* \# - id of method which is used for navigation in the prompt
* AVG_CT - average calls count of that method between all the collected profiles
* min_ct - minimum calls count in all the profiles (0 is not counted, so the minimum is 1)
* max_ct - maximum calls count in all the profiles
* AVG_WT - average wall time (total execution time of the method) between all the collected profiles
* PERCENT_WT - 90-th percentile of wall time between all the collected profiles
* max_wt - maximum wall time between all the collected profiles
* mark - used to marking method in prompt (just a star sign to mark anything you want, does not affect anything)
* method - method name
## Prompt commands
* q - exit
* 0 - go back in the tree
* 1,2,3... - go to method N
* m1,m2,m3... - place a star sign on method N (it was meant to mark methods you've already looked at)