Unfortunately, the profiler is not outputting data on my own controller actions, but those (including how magento comes to execute this action) I would like to profile.

Is there a code I can run in the end of my action to output the collected profiler data?


I found the solution via that answer: Varien_Profiler and _redirect in Adminhtml

Since the link didn't work anymore, I used archive.org's wayback machine.

Here the code:

    $timers = Varien_Profiler::getTimers();
    $out = "\n";
    foreach ($timers as $name=>$timer) {
        $sum = Varien_Profiler::fetch($name,'sum');
        $count = Varien_Profiler::fetch($name,'count');
        $realmem = Varien_Profiler::fetch($name,'realmem');
        $emalloc = Varien_Profiler::fetch($name,'emalloc');
        if ($sum<.0010 && $count<10 && $emalloc<10000) {
        $out .= number_format($sum,4)."\t".$count."\t".$name."\n";
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.