定制 bankiru/yii-pinba 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bankiru/yii-pinba

最新稳定版本:v0.2.0

Composer 安装命令:

composer require bankiru/yii-pinba

包简介

README 文档

README

Simple Yii extension that incapsulates Pinba configuration and methods.

Build Status Scrutinizer Code Coverage Status Coveralls Code Coverage Status Scrutinizer Quality Score SensioLabsInsight Dependency Status HHVM Status License

Installing

You should install php pinba extension manually. See documentation.

Composer

"require": {
  "bankiru/yii-pinba": "~0.1"
}

Github

Releases of Pinba extension for Yii framework are available on Github.

Documentation

To enable this extension you need add Pinba to component list in config.php and do some simple configurations

'pinba' => array(
    'class'         => 'Bankiru\\Yii\\Profiling\\Pinba\\Pinba',
    'fixScriptName' => true, // changes script_name in pinba to controller/action or to command args in cli mode. Default true
    'scriptName'    => null,   // default null (if null pinba would use autodetect)
    'hostName'      => null, // default null (if null pinba would use autodetect)
    'serverName'    => null, // default null (if null pinba would use autodetect)
    'schema'        => null, // default null (if null pinba would use autodetect)
    'profileEvents' => [], // default empty array
)

In addition you need to add pinba extension to preload section.

Available 2 methods to profile.

  • through direct call Timer class
  • using yii events

Timers class

Timer class has static methods:

  • start
  • stop
  • add
  • delete
  • tagsMerge
  • tagsReplace
  • dataMerge
  • dataReplace
  • getInfo
  • getAll
  • stopAll

which wraps pinba_* functions.

Yii events

Extension always tracks CApplication request (onBeginRequest, onEndRequest).

Custom profilings can be added through config. For example:

'pinba' => array(
    'class' => 'Bankiru\\Yii\\Profiling\\Pinba\\Pinba',
    'profileEvents' => [
        ['my-component-name', 'profiling_action_name', 'onBeginActionEventName', 'onEndActionEventName'],
    ],
)

统计信息

  • 总下载量: 13.27k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 11
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-04-24