Studyon Minte9.com
ZF 1.0




Profiler



Profiles include the queries processed by the adapter as well as elapsed time to run the queries.

//Application/Plugin/DBConnection
$db = Zend_Db::factory(_DB_ADAPTER, array(
	'host'		=> _DB_HOST,
	'username'	=> _DB_USERNAME,
	'password'	=> _DB_PASSWORD,
	'dbname'	=> _DB_DATABASE,
	'port'		=> _DB_PORT,
	
	'profiler'  => true,
));


//controller
$profiler = $this->catgModel->getAdapter()->getProfiler();

$profile = '';
foreach($profiler->getQueryProfiles() as $query) {
    $profile .= "<br><br>".$query->getQuery() . "<br>"
	 . 'Time: ' . $query->getElapsedSecs();
}

echo $profile;



http://www.techfounder.net/2008/10/12/profiling-queries-with-zend_db-and-optimizing-them-by-hand/
http://framework.zend.com/manual/en/zend.db.profiler.html