forked from adamlaska/datatracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug.html
More file actions
48 lines (47 loc) · 1.45 KB
/
debug.html
File metadata and controls
48 lines (47 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{# Copyright The IETF Trust 2015, All Rights Reserved #}
{% load origin %}{% origin %}
{% if debug %}
{% if sql_debug %}
{% load debug_filters %}
<div id="debug">
<hr>
<p>
{{ sql_queries|length }} queries ({{ sql_queries|timesum }}s)
{% if sql_queries|length != 0 %}
<a class="btn btn-default btn-xs"
onclick="$('#debug-query-table').toggleClass('hide');">Show</a>
{% endif %}
</p>
<table class="table table-condensed table-striped tablesorter hide" id="debug-query-table">
<thead>
<tr>
<th data-header="sequence">#</th>
<th data-header="query">SQL</th>
<th data-header="count">Count</th>
<th data-header="where">WHERE</th>
<th data-header="loc">View/ Templ.</th>
<th data-header="time">Time</th>
<th data-header="acc">Acc.</th>
</tr>
</thead>
<tbody>
{% with sql_queries|annotate_sql_queries as sql_query_info %}
{% for query in sql_query_info %}
<tr>
<td>{{ forloop.counter }}</td>
<td>{{ query.sql|expand_comma|escape }}</td>
<td>{{ query.count }}</td>
<td>{{ query.where }}</td>
<td>{{ query.loc }}</td>
<td>{{ query.time }}</td>
<td>{{ query.time_accum }}</td>
</tr>
{% endfor %}
{% endwith %}
</tbody>
</table>
</div>
{% else %}
<div class='text-center text-muted small'>Add 'ietf.context_processors.sql_debug' to settings.TEMPLATE_CONTECT_PROCESSORS to turn on the SQL statement table</div>
{% endif %}
{% endif %}