sp-niemand/yii2-pinba
Composer 安装命令:
composer require sp-niemand/yii2-pinba
包简介
Pinba for Yii2
README 文档
README
Description
Installation
Use composer to install:
composer require sp-niemand/yii2-pinba
Usage
Standard
Add the main component and the log target to the config.
'bootstrap' => [/* ... */ 'pinba' /* ... */], 'components' => [ // ... 'pinba' => [ 'class' => \yiiPinba\component\Pinba::className(), ], // ... 'log' => [ 'targets' => [ // ... [ 'class' => \yiiPinba\log\Target::className(), ], // ... ] ] // ... ]
The target handles export of the profile logs to Pinba. Use standard Yii2 method for profiling:
\Yii::beginProfile($token, $category); // ... \Yii::endProfile($token, $category);
Bootstrapping is needed if you want to automatically time actions run.
Low level
Of course, you can use methods from the component directly:
$p = \Yii::$app->get('pinba'); /** @var Pinba $p */ $p->startTimer('timer1'); // ... $p->stopTimer('timer1');
统计信息
- 总下载量: 12.05k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 10
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-10-15