Laravel-debugbar: Highlighting / grouping duplicate queries

Created on 20 Jan 2015  路  6Comments  路  Source: barryvdh/laravel-debugbar

When using Debugbar it tells me I have n duplicate queries, however it's not clear unless I look through all queries which ones are duplicate.

It'd be great if there was a way of highlighting this, or perhaps filtering by only duplicate queries with a count and perhaps the sum of all query time for each query.

stale

Most helpful comment

It should have a slightly different background (more grey) if it's a duplicated query. But I agree it could be more clear.

All 6 comments

It should have a slightly different background (more grey) if it's a duplicated query. But I agree it could be more clear.

In Django debug toolbar you will see the number of duplicates under every row. https://i.stack.imgur.com/0O9Uz.png

The slight color difference is not good because it is no way the user understands that it is a duplicate and if you are color blind it is impossible.

Now the duplicate calculation is done in js, i think it should be in php but i don't know the whole picture.

You could do this trick...

 <script type="text/javascript">
    window.toggleSqlDuplicate = function () {
        $('div.phpdebugbar-widgets-sqlqueries li').not('.phpdebugbar-widgets-sql-duplicate').toggleClass('hidden');
    }
</script>

and for more visible highilighting
```

``` Then open chrome dev tools console and enter thistoggleSqlDuplicate()`

I made a js bookmarklet for this. Just create a bookmark and use this for the location. Then just click the bookmark to toggle the dupes on/off.

javascript:(function(){ if (typeof toggleSqlDuplicate !== 'function') { window.toggleSqlDuplicate=function (){$('div.phpdebugbar-widgets-sqlqueries li').not('.phpdebugbar-widgets-sql-duplicate').toggleClass('hidden');} } toggleSqlDuplicate(); })(); 

I had to tweak @steveheinsch bookmark slightly to the following for it to work for me:

javascript:(function(){ if (typeof toggleSqlDuplicate !== 'function') { window.toggleSqlDuplicate=function (){$('.phpdebugbar-widgets-list > li').not('.phpdebugbar-widgets-sql-duplicate').toggle();} } toggleSqlDuplicate(); })();

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If this issue is still present on the latest version of this library on supported Laravel versions, please let us know by replying to this issue so we can investigate further.
Thank you for your contribution! Apologies for any delayed response on our side.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Megachill picture Megachill  路  3Comments

mnameghi picture mnameghi  路  6Comments

ddmo picture ddmo  路  3Comments

innerdev picture innerdev  路  5Comments

kjhatis picture kjhatis  路  5Comments