sp-niemand/yii2-pinba Pinba for Yii2

profilepinbaprofilingyii2-pinba

yii2-pinba

Description

Integrates pinba with Yii2

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');

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

No stable releases.

Comments



No stable releases.



MIT license
Stats
8 github stars & 4 github forks
2 downloads in the last day
293 downloads in the last 30 days
2121 total downloads