You can add a profiler to the doctrine package
namespace Doctrine\DBAL\Logging; class Profiler implements SQLLogger { public $start = null; private $ci; public function __construct() { $this->ci =& get_instance(); } public function startQuery($sql, array $params = null, array $types = null) { $this->start = microtime(true); $this->ci->db->queries[] = "/* doctrine */ \n".$sql; } public function stopQuery() { $this->ci->db->query_times[] = microtime(true) - $this->start; } }
Then load the profiler as a registrar in your main doctrine library (doctrine.php for me)
$logger = new \Doctrine\DBAL\Logging\Profiler; $config->setSQLLogger($logger);
And normal profiling will work fine.
source share