Search code examples
zend-frameworkzend-dbprofilerzend-db-table

Is it possible to profile Zend_Table queries?


I'm looking for a way to profile queries which are performed internally by Zend_Table.
For example, after you finish Quickstart course, how to profile all the queries that are performed ?
I've tried to enable profiler from application.ini like this:

resources.db.profiler.class   = "Zend_Db_Profiler_Firebug"
resources.db.profiler.enabled = true

And placed next rows in a Guestbook controller:

...
$db = Zend_Db_Table_Abstract::getDefaultAdapter();
$profiler = $db->getProfiler();

echo $profiler->getTotalElapsedSecs();

Which gives me 0

I've also tried to enable profiler in a Bootstrap file like this:

protected function _initProfiler() {
    $this->bootstrap("db");
    $profiler = new Zend_Db_Profiler_Firebug("All DB Queries");
    $profiler->setEnabled(true);
    Zend_Registry::get("db")->setProfiler($profiler);
}

Whick doesn't give me any result (I've installed and tested Firebug and FirePHP, using Zend_Log_Writer_Firebug())

I will appreciate any help. Thanks !


Solution

  • The problem was in the parameters instantiation. When I've entered

    resources.db.params.profiler.class   = "Zend_Db_Profiler_Firebug"
    resources.db.params.profiler.enabled = true
    

    instead of previous configuration, everything went fine. Note .params section of the parameter lines