Coder Social home page Coder Social logo

isabella232 / xhprof_console Goto Github PK

View Code? Open in Web Editor NEW

This project forked from badoo/xhprof_console

0.0 0.0 0.0 5 KB

A console tool for grabbing profiles from XHProf database and collecting aggregates from them

License: MIT License

PHP 100.00%

xhprof_console's Introduction

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)

xhprof_console's People

Contributors

phoenix-mstu avatar

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.