{% extends "base.html" %}
{% block title %}Cortex Metrics — ICDEV™{% endblock %}
{% block content %}
No Cortex audit data yet — metrics populate as governed calls run. (The cortex_audit table may not exist on a fresh database until the first call.)
{% else %}
{% set s = stats.summary %}
{% macro card(label, value, hint='') -%}
{{ label }}
{{ value }}
{% if hint %}
{{ hint }}
{% endif %}
{%- endmacro %}
{{ card('Calls', s.calls) }}
{{ card('Blocked', s.blocked, s.block_rate_pct ~ '% block rate') }}
{{ card('Redactions', s.redactions, 'PII/CUI spans masked') }}
{{ card('Cache hits', s.cache_hits) }}
{{ card('Cost (USD)', '$%.4f'|format(s.cost_usd)) }}
{{ card('Avg latency', s.avg_latency_ms ~ ' ms') }}
{{ card('Tokens', '{:,}'.format(s.total_tokens), '{:,} in / {:,} out'.format(s.input_tokens, s.output_tokens)) }}