We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Database profiling

Hi!

Docs say:


$profiler = new \Phalcon\Db\Profiler();

 // Set the connection profiler
$connection->setProfiler($profiler);

However, the "setProfiler" method does not exist.

Any idea?

Hi Sergey, you can check this other examples in documentation

Model: Profiling SQL Statementst

Database: Profiling SQL Statements

Set profiler is part of Mysql $connection = new \Phalcon\Db\Adapter\Pdo\Mysql([...]); you can get from DI if you have one service for db connection and other for profiling

Good Luck