Profiler (DB)

Database Profiling

Instances of Phalcon\Db can generate execution profiles on SQL statements sent to the relational database. Profiled information includes execution time in milliseconds. This helps you to identify bottlenecks in your applications.

Configurations

# set true to enable profiling
APP_PROFILER=true

# define your own service provider
PROVIDER_PROFILER=\Zemit\Provider\Profiler\ServiceProvider

Usage

// if the class is aware of injections
$profiler = $this->profiler;

// if the container is present
$profiler = $this->di->get('profiler');

// from outside
$profiler = Di::getDefault()->get('profiler');

Phalcon\Db

Sources

Last updated