-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Generate stats - fix slow loading of media files. #731
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
Merged
tim-schilling
merged 5 commits into
django-commons:master
from
tim-schilling:generate-stats
Jul 18, 2015
Merged
Generate stats - fix slow loading of media files. #731
tim-schilling
merged 5 commits into
django-commons:master
from
tim-schilling:generate-stats
Jul 18, 2015
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
generate_stats is not always called. It will only be called when the toolbar is going to insert itself into the response. The method process_response will always be called and should be used for panels that need to interrupt the request such as the RedirectsPanel. This update is to address issue #517.
While this hasn't caused any issues with the actual usage of the toolbar, it has caused an unexpected error within the unit tests. This is because the dictionary returned by stats is converted into a list. The order of this list isn't consistent, while the logic expects it to which gave it the random feel to it. Ignoring the call to the disable should cause the view function to be the only function with zero callers.
This looks pretty good, please go ahead. |
One last thing: a line in the release notes would certainly help maintainers of third-party panels. |
Thanks @aaugustin for the quick and thorough review! I'll get those changes made and merge this in. |
Added a line for the 1.4 release which will contain this new method. Revised the sphinx method references for generate_stats and process_response to actually link to each other. Following the existing format to link to process_response lead to a link being generated to Django's actual process_response method on the middleware. I had to specifically mention the toolbar's process_response and then updated the generate_stats reference to be consistent between the two methods.
The func variable is a tuple, so each element needs to be checked for the profiler.
tim-schilling
added a commit
that referenced
this pull request
Jul 18, 2015
Generate stats - fix slow loading of media files.
ryneeverett
pushed a commit
to ryneeverett/django-debug-toolbar
that referenced
this pull request
Oct 2, 2016
Generate stats - fix slow loading of media files.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request has been created to address the slow loading of media files from issue #517.
It uses the design that @spookylukey laid out of creating a method called
generate_stats
that will only be called when the toolbar will be inserted into the response.