Reputation: 76892
I'm new to Debug Kit and spent this day with studying it, looking at its source-code, reading about it to gather as much information as possible. Even though I'm not an expert about this plugin, I think I'm ready to ask a question here on SO about it.
Documentation link: https://book.cakephp.org/debugkit/4/en/index.html
While working on a group of inter-related projects, I was asked to look into ways to add a SQL debugger/logger feature hopefully along with a UI, using the model of an already existent solution at a project.
While looking into this tool, I have found out that it is CakePHP's Debug Kit, with some project-specific customizations.
Now, introducing it into the problem-space I was asked is an interesting problem, because it is a reporting problem-space which works as follows:
What I would like to profile and benchmark is what happens when the report is at the head of the queue and is being processed.
Even though in this case many physical server machines and different databases may be involved, from the perspective of this question this kind of complexity is irrelevant, I'm happy to handle it. Let's simplify it and assume for the sake of simplicity that I have a reports table and each report has its own ID.
I would like to use Debug Kit as follows:
My question is as follows: Is there a way to use Debug Kit in the use-case I have described above and if so, how?
Upvotes: 0
Views: 67
Reputation: 76892
It turns out that
$connection->fullDebug = true;
enables SQL logging and then later
$connection->getLog(true);
returns all the needed information. $connection
needs to be an DboSource instance.
Upvotes: 1