{% if profile_stats %}
Call-Stack Profile {{ profile_stats | length }} functions sorted by cumulative time ยท user code only
{# Header #} Function Calls Own Total Time bar {# Rows #} {% for stat in profile_stats %} {% set pct = (stat.ct_ms / max_ct_ms * 100) | round(1) %} {# Function cell โ€” spans all rows for this stat #}
{{ stat.func }} {{ stat.file }}{% if stat.line %}:{{ stat.line }}{% endif %} {% if stat.callers %}
Called from {{ stat.callers | length }} location{% if stat.callers | length != 1 %}s{% endif %}
{% for c_file, c_func, c_line, c_ct in stat.callers %} {{ c_func }} โ€” {{ c_file }}{% if c_line %}:{{ c_line }}{% endif %} ({{ "%.2f"|format(c_ct) }}ms) {% endfor %}
{% endif %}
{{ stat.calls }} {{ "%.2f"|format(stat.tt_ms) }}ms {{ "%.2f"|format(stat.ct_ms) }}ms
{% endfor %}
{% else %}
No profile data for this request. {% if record.profile_stats is none %} Enable enable_profiling=True in Config (or set FLOWSURGEON_PROFILING=1) to capture call-stack data. {% else %} No user-code frames were captured โ€” try setting profile_user_code_only=False to include stdlib frames. {% endif %}
{% endif %}