{% from '_fmt.html' import count, usd, usd_exact %} {% macro bars(data, title, unit='') %}
{{ title }} {{ unit }}
{% for row in data.rows %}
{{ row.label }}{% if unit.startswith('USD') %}{{ usd(row.value) }}{% else %}{{ '%.6g'|format(row.value) }}{% endif %}
{% else %}

No recorded measurements.

{% endfor %} {% if data.omitted %}Top {{ data.rows|length }} shown; {{ data.omitted }} more in the tables.{% endif %}
{% endmacro %} {% macro trend(data, title, unit='') %}
{{ title }} {{ unit }}
{% if data.rows %} {% for row in data.rows %}{{ row.label }}: {{ '%.6g'|format(row.value) }} {{ unit }}{% endfor %} {{ data.rows[0].label }}{{ data.rows[-1].label }}
Chart data{% for row in data.rows %}{% endfor %}
Date{{ unit }}
{{ row.label }}{{ '%.6g'|format(row.value) }}
{% if data.omitted %}{{ data.omitted }} dates omitted from chart; use the date filter or JSON export.{% endif %} {% else %}

No recorded measurements.

{% endif %}
{% endmacro %} {% macro donut(data, title) %}
{{ title }} Approximate tokens
{% if data.total %}
{% for row in data.rows %}{{ row.label }}: {{ row.share|round(1) }}%{% endfor %}
{% else %}

No attributed memory measurements.

{% endif %}
{% endmacro %} {% macro usage_table(rows, title, links=false) %}
{{ title }} {{ count(rows|length) }} row{{ '' if rows|length == 1 else 's' }}
{% for row in rows[:200] %}{% else %}{% endfor %}
ScopeCallsRecorded tokensKnown chargePriced / callsLatency mean / p95 (ms)
{% if row.trace_url %}{{ row.label }}{% else %}{{ row.label }}{% endif %} {{ count(row.calls) }}{{ count(row.total_tokens) }}{% if row.unknown_usage_calls %} {{ count(row.unknown_usage_calls) }} unknown{% endif %} {{ usd(row.cost_usd) }}{{ count(row.priced_calls) }} / {{ count(row.calls) }} {{ '{:,.1f} / {:,.1f}'.format(row.mean_latency_ms, row.p95_latency_ms) if row.mean_latency_ms is not none else 'Unknown' }}
No recorded calls in this window.
{% if rows|length > 200 %}

First 200 rows shown. Use filters or JSON export for the full bounded window.

{% endif %}
{% endmacro %}