{% extends 'mastery/base.html' %} {% load i18n %} {% load l10n %} {% block details %}

{% translate "Summary Debug Metrics" %}

{% translate "KPI-first view of optimization metrics grouped by phase" %}
{% blocktranslate with count=snapshot_count %}{{ count }} snapshots{% endblocktranslate %}
{% if snapshots %}
{% translate "Reading tip:" %} {% translate "select a snapshot in the left column; higher ms badges usually deserve first attention" %}
{% for source_group in snapshot_sources %}
{% for snapshot in source_group.snapshots %} {% with p0=snapshot.metrics.p0_metrics.summary_view p2=snapshot.metrics.p2_metrics.character_skills p3=snapshot.metrics.p3_metrics.shared_progress_cache %}
{{ snapshot.source }} #{{ forloop.counter }}
{{ snapshot.captured_at_human }}
{% translate "View total" %}
{{ p0.view_total_ms|default:0 }} ms
{% translate "SQL queries" %}
{{ p0.sql_query_count|default:0 }}
{% translate "Progress calls" %}
{{ p0.progress_calls|default:0 }}
{% translate "P0 hit ratio" %}
{% with p0_hits=p0.progress_cache_hits|default:0 p0_misses=p0.progress_cache_misses|default:0 %} {% with total=p0_hits|add:p0_misses %} {% if total %} {% widthratio p0_hits total 100 %}% {% else %} — {% endif %} {% endwith %} {% endwith %}
{% translate "P2 rows loaded" %}
{{ p2.prime_rows_loaded|default:0 }}
{% translate "P3 hit ratio" %}
{% with p3_hits=p3.cache_hits|default:0 p3_misses=p3.cache_misses|default:0 %} {% with total=p3_hits|add:p3_misses %} {% if total %} {% widthratio p3_hits total 100 %}% {% else %} — {% endif %} {% endwith %} {% endwith %}
{% translate "Phase P0 - Baseline" %}
{% translate "View total (ms)" %}{{ p0.view_total_ms|default:0 }}
{% translate "SQL queries" %}{{ p0.sql_query_count|default:0 }}
{% translate "Progress calls" %}{{ p0.progress_calls|default:0 }}
{% translate "Progress cache hits" %}{{ p0.progress_cache_hits|default:0 }}
{% translate "Progress cache misses" %}{{ p0.progress_cache_misses|default:0 }}
{% translate "Progress cache entries" %}{{ p0.progress_cache_entries|default:0 }}
{% translate "Member groups" %}{{ p0.member_groups|default:0 }}
{% translate "Active characters" %}{{ p0.active_characters_total|default:0 }}
{% translate "Phase P2 - Character skills batching" %}
{% translate "Prime calls" %}{{ p2.prime_calls|default:0 }}
{% translate "Prime character ids" %}{{ p2.prime_character_ids_total|default:0 }}
{% translate "Prime already cached" %}{{ p2.prime_already_cached|default:0 }}
{% translate "Prime uncached" %}{{ p2.prime_uncached|default:0 }}
{% translate "Rows loaded" %}{{ p2.prime_rows_loaded|default:0 }}
{% translate "Cache hits" %}{{ p2.cache_hits|default:0 }}
{% translate "Cache misses" %}{{ p2.cache_misses|default:0 }}
{% translate "DB loads" %}{{ p2.db_loads|default:0 }}
{% translate "Skills loaded" %}{{ p2.skills_loaded|default:0 }}
{% translate "Phase P3 - Shared progress cache" %}
{% translate "Cache hits" %}{{ p3.cache_hits|default:0 }}
{% translate "Cache misses" %}{{ p3.cache_misses|default:0 }}
{% translate "Cache writes" %}{{ p3.cache_writes|default:0 }}
{% translate "Stale fallbacks" %}{{ p3.stale_fallbacks|default:0 }}
{% translate "Hit ratio" %} {% with p3_hits=p3.cache_hits|default:0 p3_misses=p3.cache_misses|default:0 %} {% with total=p3_hits|add:p3_misses %} {% if total %} {% widthratio p3_hits total 100 %}% {% else %} — {% endif %} {% endwith %} {% endwith %}
{% endwith %} {% endfor %}
{% endfor %}
{% else %}
{% translate "No summary debug metrics captured yet. Visit summary pages to generate snapshots." %}
{% endif %}
{% endblock %}