fbi/yii2-xhprof

Yii2 provide support for xhprof

Installs: 84

Dependents: 0

Suggesters: 0

Security: 0

Type:yii2-extension

V1.0.0 2015-04-21 10:58 UTC

This package is not auto-updated.

Last update: 2024-05-15 07:41:21 UTC


README

xhprof for yii2

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require fbi/yii2-xhprof "*"

for dev-master

php composer.phar require fbi/yii2-xhprof "dev-master"

or add

"fbi/yii2-xhprof": "*"

to the require section of your composer.json file.

Usage

  1. add the following code to your entry script,for example: index.php

    defined('YII_PROFILE') or define('YII_PROFILE',true);
    
  2. then modify your application configuration as follows at the end of your config file:

if (YII_PROFILE){
	$config['bootstrap'][] = 'xhprof';
	$config['modules']['xhprof'] = [
		'class'=>'fbi\xhprof\Module',
		'frequency'=>1000,//record rate
		'minExcutionTime'=>1,//
		//'name'=>'linkserver',//xhprof source,default value: Yii::$app->id
		//'dir'=>'/tmp',//record path ,default value: @runtime/xhprof/
	];
}
  1. then you browse the profs var http://your.site.name/index.php?r=xhprof

sanwkj@163.com