How to install YII Profiler to elevate or optimize your YII code in seconds

How to install YII Profiler to elevate or optimize your YII code in seconds 05Jun, 2014

YII Profiler help you examine the performance of your applications and improve poorly execution sections of code. They deliver dimensions of how long a routine takes to execute, how often it is called, where it is called from, and how much of total time at some spot is spent executing that routine. Profiling is exclusively valuable when functioning with database since SQL executions are often the main performance holdup of an application.

Developed using Yii Framework 1.1.8 but it may work with other versions.

Here are the simple step-by-step instructions to use this extension.
Download and extract the contents of the zip to your extensions folder
– Add the following code to your app configuration file found at protected/config/main.php
– Update the Log Route in your application configuration

'log'=>array(
'class'=>'CLogRouter',
'routes'=>array(
array(
'class'=>'CFileLogRoute',
'levels'=>'error, warning',
),
array(
'class' => 'application.extensions.pqp.PQPLogRoute',
'categories' => 'application.*, exception.*',
),
),
),

– Enable Database Profiling and param loggin:

'db'=>array(
'connectionString' => '...',
'enableProfiling' => true,
'enableParamLogging' => true,
),

– The profiler will be displayed at the footer position of the site with console, load time, database queries and included file details.
code_profiler

Posted by: DineshSaini / In: YII and Tagged ,
Cam

Leave a Reply

Your email address will not be published. Required fields are marked *