Silverstripe DBProfiler

silverstripe

-- This module is currently getting rewritten as a SilverStripe 3.0 module, I recommend having a look at silverstripe-profiler instead. --

DBProfiler is a small module to the Silverstripe CMS that makes it easy for a developer to keep track of how the application utilizes the database directly in the database.

Below is an extract of the README file.

Installation

Change your database class in the _ss_environment.php to:

define('SS_DATABASE_CLASS', 'ProfilerMySQLDatabase');

Do a ?flush=1 on the site

Usage

Try to clear all caches you might have and go to a page of your choice in your browser

The site will load as normal and at the bottom of the page you should see a bar at the bottom of the page with some information E.g:

PHP peak memory: 20.25MB | Querysize: 4.49KB | Queries: 15 (13 unique) | Time in db: 10.53ms | Read more

To remove all queries that are duplicates, click on the link named 'unique', the page will reload and you can see if this has any impact on the page load time.

You might also click on the 'Read more' link to get more detailed information about all queries that was sent to the database and also find a backtrace of where they originated from.

Have a look at dbprofiler