Giter VIP home page Giter VIP logo

phpio's Introduction

PHPIO

Cross request trace for PHP,like google's dapper,twitter's zipkin.
It's base on AOP-PHP extension. PHPIO is focus on trace IO operation, such like Curl, MySQL, Memcache, Redis, APC.
It's easily write your own Hooker monitor function/class operation in 10 line code.

  • Common
    connection's host and port, call trace, function args, response and error message.
  • MySQL, PDO
    record raw SQL query stirng and affected rows.
  • Curl
    record raw http header(request & response), and reporting the full infomation of time,speed and size.
  • Memcached, Redis
    record key for operation, the real server where key is mapped to.
  • Exception, Error
    record errno and errmsg for Exception and Error.
  • Call Graph
    call graph is svg format, click map node redirect to source.
  • Source viewer
    you can see all your source code which been executed.
  • Cross Request Tracking
    A unique request_id is auto inject in Cookie for track http request from frontpage to webservice api, just use a Redis logger can collecting logs from all your php web servers.

DEMO

Screenshot

Install aop extension

pecl install aop-beta
[aop]  
extension=aop.so 

if coredump ?

  1. change you aop extension version (the pecl version is stable than github)
  2. rebuild php

get phpio

download tarball

wget https://github.com/hemon/phpio/tarball/master -O phpio.tar.gz  
tar xvf phpio.tar.gz  

or git clone

git clone https://[email protected]/hemon/phpio

prepend phpio.php

php.ini

auto_prepend_file = /path/to/phpio/phpio.php  

php-fpm

php_admin_value[auto_prepend_file] = /path/to/phpio/phpio.php

start profile

run you php programs with param _debug_phpio=1

$_REQUEST['_debug_phpio']=1  
$_COOKIE['_debug_phpio']=1  
$_SERVER['_debug_phpio']=1  

for example : http://www.example.com/index.php?_debug_phpio=1

recommand firfox addon easy-xdebug, it can auto append user defined cookie param in request(default is _debug_phpio=1):

in php-cli mode, use export command to set param for $_SERVER

export _debug_phpio=1

view profile

make phpio/www is accessible:

http://localhost/phpio/www/  

phpio's People

Contributors

hemon avatar vissul avatar

Watchers

James Cloos avatar Bulldozer 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.