{# Pareto + binary-splits panel. Embedded full-page on first render and re-fetched as an HTMX fragment when the user clicks a daily/hourly bar on the cost chart. The container ``#cost-portfolio-panel`` is owned by ``cost_overview.html``; this partial is what gets swapped. #} {% from "_spend_shapes.html" import split_cell, spark_cell %} {% if is_filtered %}
These {{ pareto.pareto_session_count }} sessions represent 80% of {{ pareto.total_cost }} total cost ({{ pareto.pareto_cost }} cumulative).
{% else %}No cost data{% if is_filtered %} for {{ filter_label }}{% endif %}.
{% endif %}Sessions ranked by cost. The highlighted row is where cumulative spend crosses 80% — everything above it is the "vital few".
Cost split: cache read cache write output
| Started | Project | Title | Cost | Cost split | Spend shape | Cumulative | % of total |
|---|---|---|---|---|---|---|---|
| {{ row.started_at }} | {{ row.project }} | {{ row.title or row.session_id[:8] }} | {{ row.cost }} | {{ split_cell(row.split) }} {{ spark_cell(row.spark) }}{{ row.cumulative }} | {{ "%.1f"|format(row.cum_pct) }}% |
No sessions with cost{% if is_filtered %} during {{ filter_label }}{% endif %}.
{% endif %}Each breakdown partitions every session into two buckets and compares total spend. "% of total $" sums to 100% across the pair.
{{ hint }}
| Sessions | Total $ | Mean $ | % of total $ | |
|---|---|---|---|---|
| With | {{ split["with"].sessions }} | {{ split["with"].cost }} | {{ split["with"].mean_cost }} | {{ "%.1f"|format(split["with"].pct_cost) }}% |
| Without | {{ split["without"].sessions }} | {{ split["without"].cost }} | {{ split["without"].mean_cost }} | {{ "%.1f"|format(split["without"].pct_cost) }}% |