Profiler

Hi,

has Yii Profiler feature like Kohana does:

?

pion

Yii::beginProfile() and Yii::endProfile(). Please see the Yii API on how to use them.

You also find more information in the logging section of the guide:

http://www.yiiframework.com/doc/guide/topics.logging

Thanks. Could You tell me how display all results (such as benchmarks, database queries…)?

Guide covers this topic very well: http://www.yiiframework.com/doc/guide/topics.logging#performance-profiling

Configure CProfileLogRoute:


    'components'=>array(

        'log'=>array(

            'class'=>'CLogRouter',

            'routes'=>array(

                    array(

                        'class'=>'CProfileLogRoute'

                    ),

            ),

        ),



Also activate profiling in your DB configuration:


        'components'=>array(

            'db'=>array(

                ...

                'enableProfiling' => true,

            ),

        ),



Then add calls to begin/endProfile() in your code to specify those blocks you like to profile:




Yii::beginProfile('blockID');

...code block being profiled...

Yii::endProfile('blockID');