Code Monkey home page Code Monkey logo

Comments (17)

samdark avatar samdark commented on July 19, 2024

My main motivator is to find out slow parts and optimize them.

from yii2-debug.

joe-meyer avatar joe-meyer commented on July 19, 2024

Personally if I want to see something (even database profiling) in order by time I find that usually I want to look at the "Profiling" tab anyway. This gives more verbose stack output than the simplified database profiling (which doesn't list things like database connection opening / closing). Additionally it does default to sort by the time column.

from yii2-debug.

mikehaertl avatar mikehaertl commented on July 19, 2024

+1 for sort order by time of execution. I was very confused today and spent quite some time to figure out, why some query was executed before some other query, which was not possible by looking at my code. I had to open #60 where @samdark finally pointed me to the default sorting.

To me it's quite un-intuitive.

from yii2-debug.

mikehaertl avatar mikehaertl commented on July 19, 2024

... or if you do default sorting by duration, then at least keep the # column intact. Why is there a 1 in that column if that wasn't the first query being executed?

from yii2-debug.

samdark avatar samdark commented on July 19, 2024

Last suggestion totally makes sense.

from yii2-debug.

samdark avatar samdark commented on July 19, 2024

Also we may consider making sorting sticky.

from yii2-debug.

mikehaertl avatar mikehaertl commented on July 19, 2024

My main motivator is to find out slow parts and optimize them.

Right, so sorting by duration is fine under "Profiling". But why do the same under "Database" by default? I expect to see the DB related log entries there. And log entries are usually always ordered by timestamp.

from yii2-debug.

mikehaertl avatar mikehaertl commented on July 19, 2024

Now what is really funny: Under "Profiling" the rows are obviously sorted by timestamp by default. :D

from yii2-debug.

thiagotalma avatar thiagotalma commented on July 19, 2024

@samdark my suggestion:

Use the "sort" as a module property and allow each developer to do the way he wants, specific to each panel.

Something like this:

Module.php

    public $panelSort = [
        '_default' => [
            'attributes' => ['duration', 'seq', 'type', 'query'],
            'defaultOrder' => [
                'duration' => SORT_DESC
            ]
    ];
    private function getSort($panel)
    {
        return ArrayHelper($module->panelSort, $panel, $module->panelSort['_default']);
    }

main-local.php

    [
        'bootstrap' => ['debug'],
        'modules' => [
            'debug' => [
                'class' => 'yii\debug\Module',
                'allowedIPs' => ['192.168.88.100'],
                'panelSort ' => [
                    'db' => [
                        'attributes' => ['seq', 'duration', 'type', 'query'],
                        'defaultOrder' => [
                            'duration' => SORT_ASC
                        ]
                    ]
                ]
            ]
        ]
    ]

from yii2-debug.

samdark avatar samdark commented on July 19, 2024

It's better just to make it sticky per page so when sorted once it's remembered.

from yii2-debug.

mikehaertl avatar mikehaertl commented on July 19, 2024

Sticky is fine. But still there should be sane defaults. I think, the current ones are not. They are exactly the opposite of what you would expect:

  • Profiling: Sort by duration
  • Database, Logs: Sort by timestampl

from yii2-debug.

samdark avatar samdark commented on July 19, 2024

Agree.

from yii2-debug.

cbepxpa3ym avatar cbepxpa3ym commented on July 19, 2024

This still needs to be done, please.

from yii2-debug.

thiagotalma avatar thiagotalma commented on July 19, 2024

@yiisoft/core-developers
Hi guys, we need more opinions here...

Edit: I can't mention teams 😯

from yii2-debug.

samdark avatar samdark commented on July 19, 2024

I've voiced my opinion already. @yiisoft/core-developers?

from yii2-debug.

thiagotalma avatar thiagotalma commented on July 19, 2024

@samdark I can send a PR with the above suggestion?

from yii2-debug.

cbepxpa3ym avatar cbepxpa3ym commented on July 19, 2024

It's useless, I think. Just what mikehaertl suggested would be enough.

from yii2-debug.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.