Sep 5, 2013

Magento: How to enable Profiler in magento?

First thing you my uncomment below code in your index.php
Varien_Profiler::enable();

Enable the store profiler in your magento admin. See the configuration in.
System -> Configuration -> Developer -> Debug -> Profiler

NOTE: if you are working on costumed magento theme be sure the profiler block added in you page.xml
<default translate="label" module="page">
// Some other stup here.
<block type="core/profiler" output="toHtml" name="core_profiler" />
</default>

If you want to profile your own module you can declare do below code.
Varien_Profiler::start('NameOfFragmentToProfile');
//
// ... Some batch of code here.
//
Varien_Profiler::stop('NameOfFragmentToProfile');

No comments: