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.
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
Track and display middleware time in the toolbar #2049
base: main
Are you sure you want to change the base?
Track and display middleware time in the toolbar #2049
Changes from 3 commits
68ca369
0c94a14
6714742
ebb7571
e029174
cb45e18
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other thing I was thinking about is how to handle measuring the full time of the toolbar's processing. This is actually stopping before all the
Panel.generate_stats()
methods are called which contains quite a bit of logic. I think ideally we'd capture that in this timing.The problem is, how do we capture that? I have a few ideas, but I'm not happy with them.
I think we could measure the end time in
TimerPanel.generate_stats()
like we do with the rest and store it. This means any other panels that generate their stats after theTimerPanel
would not be included. To mitigate that, we could find a way to make sure thatTimerPanel
is first to enable and last to generate stats. I think having it be first inenabled_panels
would do the trick.The other idea I had was to create a templatetag that would do the diff between the stored time and the current time at the time the toolbar is rendered. The problem here is that it wouldn't be compatible with the serializable branch where we want to store all the stats before rendering.
So I think trying to consolidate all the logic into
TimerPanel
with a change to forceTimerPanel
to be first for processing (not appearance on the idea) is ideal.@salty-ivy @elineda any thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated the
enabled_panels
property to ensure theTimerPanel
is first in order. This is I think what you meant by in the first approach. The order of enabled panels is reversed in_postprocess
ensuring the end time is captured at the end.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent, thank you @earthcomfy! This is looking really nice. The last bit we need are the tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a test to ensure the timer panel is first. Are there any other tests that need to be included
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@earthcomfy ideally we'd have tests covering all the changes on the Timer panel. Or updates to similar tests to also cover these new fields.