Skip to content

Commit 96175e1

Browse files
Orders templates by starting time and summary by duration.
1 parent cad7225 commit 96175e1

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

template_profiler_panel/panels/template.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,5 @@ def process_response(self, request, response):
140140
self.total = len(self.templates)
141141

142142
self.record_stats(
143-
{'templates': self.templates, 'summary': dict(summary)})
143+
{'templates': sorted(self.templates, key=lambda d: d['start']),
144+
'summary': sorted(summary.items(), key=lambda t: -t[1])})

template_profiler_panel/templates/template_profiler_panel/template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ <h4>{% trans 'Summary' %}</h4>
4646
</tr>
4747
</thead>
4848
<tbody>
49-
{% for k, v in summary.items %}
49+
{% for k, v in summary %}
5050
<tr class="{% cycle 'djDebugOdd' 'djDebugEven' %}">
5151
<td>{{ k }}</td>
5252
<td>{{ v|floatformat }}</td>

0 commit comments

Comments
 (0)