Coder Social home page Coder Social logo

auto-xhprof's Introduction

====== auto xhprof

通过在php.ini全局预加载脚本,实现自动记录错误和性能分析数据到数据库。如支持Gearman,则异步保存数据。

依赖软件:

XHProf                  http://pecl.php.net/package/xhprof
Gearman                 http://gearman.org/
                        http://pecl.php.net/package/gearman
MySQL                   http://www.mysql.com

文件列表说明:

php.ini                 auto_prepend_file和加载模块部分配置。
auto-xhprof.php         主文件,全局加载。
auto-xhprof.ini         配置,包括数据库、超时、是否自动打开等。
auto-xhprof.sql         数据库初始化SQL脚本。
web/                    页面显示,包括分析列表以及详细xhprof页面。
xhprof_lib/             xhprof库文件。
gearman-worker.php      gearman后台处理worker进程。

php.ini配置:

; load auto-xhporf.php
auto_prepend_file = '/path/auto-xhprof.php'

; load xhprof module
[xhprof]
extension = xhprof.so
xhprof.output_dir = /tmp

; load gearman module
[gearman]
extension = gearman.so

auto-xhprof相关配置:

[auto_xhprof]
xhprof.autostart = 1
xhprof.timeout   = 2000
xhprof.ignore    = 'xhprof;phpmyadmin'
database.dsn     = 'mysql:host=127.0.0.1;dbname=xhprof'
database.user    = 'root'
database.pass    = '123456'
;gearman.server   = '127.0.0.1:4730;127.0.0.1:4730'

Gearman后台使用示例:

% gearmand -vvv -q libdrizzle --libdrizzle-host=127.0.0.1\
   --libdrizzle-user=root --libdrizzle-password=123456 --libdrizzle-db=gearman\
   --libdrizzle-table=queue --libdrizzle-mysql

% php gearman-worker.php &

页面显示修改index.php/callgraph.php中$xhprof_runs_impl实例部分,修改成XHProfRuns_DB:

$xhprof_runs_impl = new XHProfRuns_DB();
//$xhprof_runs_impl = new XHProfRuns_Default();

EOF

auto-xhprof's People

Contributors

smallfish avatar

Watchers

 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.