Add qb and quick panel #21
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a qb and Quick panel to the cbdebugger. It is on by default if qb is installed a registered. The Quick sections of the panel are only shown if Quick is also installed.
The panels show all the queries executed by qb. It includes a total count, table by timestamp, and a grouped table to show if you repeatedly execute the same kind of query. The information includes the timestamp the code was ran at, the query that was run, the total execution time (time for
queryExecute
to run and come back), and any bindings associated with the query. This panel can help identify N+1 issues and slow queries. Hopefully in the future we can include some sort of backtrace (assuming we can do it in a performant manner).The Quick section shows the number of loaded entities as this can be a sign that you are loading far more entities than you knew, for instance loading all the logins for a User just to display a
latestLogin
timestamp.Here's a screenshot showing both sections:
It would have been ideal for these to be added as some sort of modular set up that let modules contribute panels. Unfortunately, there's just not time to tackle that right now. The benefits that this panel will provide, specifically, is too valuable to make wait for that modular future.