node13h / django-debug-toolbar-template-profiler

Displays template rendering time on the timeline
Other
72 stars 14 forks source link

Break temlate parsing timeline by separate nodes #17

Closed PetrDlouhy closed 3 years ago

PetrDlouhy commented 3 years ago

I have added functionality, that shows template timeline breakdown by separate nodes like this: Snímek z 2021-01-14 20-33-54 It shows separate node runtimes by level of their tree depth with hover title dialog describing them.

I also added (almost empty) templatetag, that can be usefull to enclose bigger blocks of code for profiling:

{% load template_profiler %}

{% profile 'basehead' %}
.....
{% endprofile %}

Although the functionality is very useful as is, I was not able to identify all the runtime of template rendering - I have sometimes substantial time at the beginning of the template run without node rendering (it is visible on the screenshot). I am only guessing, that it is something like context processing or template loading.

adamchainz commented 3 years ago

Hi @PetrDlouhy

Thanks for another PR. This looks like a good improvement. Personally I don't really have the bandwidth to review or maintain at the moment. Perhaps @node13h can review, or invite you as a maintainer.

node13h commented 3 years ago

Hi, thanks for the PR @PetrDlouhy. I'm also swamped at the moment, will try to look at your PR over the weekend.

PetrDlouhy commented 3 years ago

I have added some UI improvements like use of DJDT built-in collapsible elements and highlighting timeline items on hover.

@node13h No problem, I will wait for review and suggestions.

node13h commented 3 years ago

Looks good to me. Going to merge it.