-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support ability to sort queries by alphabetical order #1669
base: master
Are you sure you want to change the base?
Support ability to sort queries by alphabetical order #1669
Conversation
Wouldn't this affect the waterfall timeline? |
I've given this a quick test and the timeline appears to be the same, I may be missing something though 👍🏼 |
I mean, each query have startTime/endTime, the graph is generated based on that, if the order is changed, there would no longer be a waterfall. laravel-debugbar/src/DataCollector/QueryCollector.php Lines 159 to 162 in bae4b22
|
maximebf/php-debugbar#410
|
I think this can't happen as the sort doesn't affect the start time/end time and in the TimeDataCollector there the waterfall order is driven via the usort that sorts via the start time https://github.com/maximebf/php-debugbar/blob/master/src/DebugBar/DataCollector/TimeDataCollector.php#L228 |
QueryCollector overwrite collect() , I have no idea why you bring it to the table.
I didn't mean that, but never mind, I'm not the one who does the merges anyway. It seems that you have not used the timeline option in QueryCollector, set laravel-debugbar/config/debugbar.php Line 223 in bae4b22
laravel-debugbar/config/debugbar.php Line 222 in bae4b22
|
Not 100% sure what you are trying to say still but now I realise it makes no sense to keep doing it on the Thanks. |
When you say "timeline", you are looking at Timelime Tab? or at The Queries Tab? |
I see what you mean now thanks I had never even realised that was a thing on there! Yeah you are correct it is affected on there, although I guess that would be expected in this context if you changed the sort. Would the waterfall be needed if sorted, as you said I was looking at the timeline tab where it is still visible. If not resolvable no problem I will just tweak things when I require but thought it would be a useful potential feature even if my implementation doesn't end up being suitable. |
Also there is database events, like laravel-debugbar/src/DataCollector/QueryCollector.php Lines 441 to 454 in bae4b22
laravel-debugbar/src/LaravelDebugbar.php Lines 372 to 424 in bae4b22
|
Hello,
In a previous PR meant to thank you for the brilliant package that has been so useful over the years!
I'm putting in this PR in the hope it will be useful to help resolve a problem I've been facing when looking through the queries tab on the debugbar to debug duplicate N+1 queries. On the particular project I was debugging there were a lot of duplicates and I was finding it difficult to determine which queries were appearing the most as duplicates and how many there were of them.
So I had an idea to maybe support the ability of sorting the queries collector by a custom sort, in this case alphabetical order. Testing this help really helped me quickly identify which queries were having the most N+1 issues.
A few thought processes I had.
Hopefully this is something that is suitable to add into the package as I think it would add a lot of value debugging and as previously mentioned open scope to sorting in order ways.
Cheers.