{% load silk_filters %}
{% if not silk_request %}
{% endif %} {% if filters and not silk_request %} {{ filters|length }} saved filter{{ filters|length|pluralize }}: {% for _, f in filters.items %}{{ f.str }}{% if not forloop.last %}, {% endif %}{% endfor %} {% endif %}
{% if tab == 'blocks' %} {% if blocks %}

Blocks wrapped in @silk_profile or with silk_profile(). Click the location to open it in your editor.

{% for b in blocks|slice:":100" %} {% endfor %}
Block SQL share
{{ b.name|default:b.func_name|default:"anonymous block" }}{% if b.raised %} {{ b.raised }} raised{% endif %} {% if b.file_path %}{% if b.func_name %}{{ b.func_name }}() · {% endif %}{{ b.file_path|app_path }}{% if b.line_num %}:{{ b.line_num }}{% endif %}{% elif b.func_name %}
{{ b.func_name }}()
{% endif %}
{{ b.runs|num }}
{{ b.total|dur }}
{{ b.avg|dur }} {{ b.max|dur }}
{% if blocks|length > 100 %}

Showing the top 100 of {{ blocks|length|num }} blocks. Search or change the sort to see others.

{% endif %} {% else %}

{% if q %}No blocks match “{{ q }}”.{% else %}No profiled code yet.{% endif %}

{% if not q %}

Wrap code in @silk_profile() or with silk_profile(name='…'): and it shows up here, with silk in INSTALLED_APPS and SilkyMiddleware in MIDDLEWARE.

{% endif %}
{% endif %} {% else %} {% if cprofile_requests %}

Requests recorded with SILKY_PYTHON_PROFILER = True, slowest first. Pick one to see where Python spent its time.

{% for r in cprofile_requests %} {% endfor %}
MethodPathQueriesTime
{{ r.method }} {{ r.path }} {% if r.view_name %}
{{ r.view_name }}
{% endif %}
{{ r.num_sql_queries }}
{{ r.time_taken|dur }}
{% else %}

No cProfile output recorded.

Set SILKY_PYTHON_PROFILER = True to profile every request with cProfile.

{% endif %} {% endif %}
{% if detail %}{% with d=detail s=detail.stats %} {% endwith %}{% endif %} {% if cprofile %}{% with c=cprofile r=cprofile.request %} {% endwith %}{% endif %}