Comments (17)
My main motivator is to find out slow parts and optimize them.
from yii2-debug.
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.
+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.
... 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.
Last suggestion totally makes sense.
from yii2-debug.
Also we may consider making sorting sticky.
from yii2-debug.
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.
Now what is really funny: Under "Profiling" the rows are obviously sorted by timestamp by default. :D
from yii2-debug.
@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.
It's better just to make it sticky per page so when sorted once it's remembered.
from yii2-debug.
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.
Agree.
from yii2-debug.
This still needs to be done, please.
from yii2-debug.
@yiisoft/core-developers
Hi guys, we need more opinions here...
Edit: I can't mention teams 😯
from yii2-debug.
I've voiced my opinion already. @yiisoft/core-developers?
from yii2-debug.
@samdark I can send a PR with the above suggestion?
from yii2-debug.
It's useless, I think. Just what mikehaertl suggested would be enough.
from yii2-debug.
Related Issues (20)
- Please rewrite comments HOT 4
- Store data in a cache HOT 3
- User switching is not working when using custom User model id HOT 1
- Mailpanel should store message in request data HOT 1
- Feature: Show repeating DB calls from the same function (regardless of the parameters) HOT 8
- User switch not working if User model has JSON/Array column HOT 2
- Don't use table-danger to indicate excessive queries HOT 3
- DB summary view uses $criticalQueryThreshold directly instead of checking via isQueryCountCritical() method HOT 2
- Mail panel broken for Symfonimailer HOT 1
- List of queries in debug panel is empty when Connection::enableProfiling is false
- Display transaction begin/end in debug panel database queries list
- DbPanel::excessiveCallerThreshold should be disabled by default
- Object of class Symfony\Component\Mime\Header\Headers could not be converted to string HOT 2
- update irc link
- update github folder link
- update docs folder links
- Switching user back to admin user is not possible when using access rules
- update src folder links
- update root folder links
- Generating a url with a trailing slash
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yii2-debug.