Expand description
Loading and shaping the data shown on the dashboard.
Structs§
- Bucket
Row - One printed row of the per-interval savings table.
- Dashboard
- Everything a page render needs.
- Savings
Row - One printed row of the savings table.
Constants§
- MAX_
BUCKET_ ROWS - How many intervals the savings table lists.
- REFRESH_
EVERY - How often a connected page re-reads the logs.
Functions§
- bucket_
noun minute,hour,dayormonth: the interval a query’s savings are grouped by.- bucket_
rows - The per-interval savings table, newest first, at most
limitrows. The interval is the chart’s: a minute, hour, day or month. - build_
dashboard - Shape collected rows into a
Dashboardscoped toselection(pure — no I/O). - load
- Read the logs on a blocking thread and build the
Dashboard. - savings_
headline compacttokens + money, for the headline card’s sub-label.- savings_
rows - The savings table: a row per source and a closing total (empty when nothing
was saved).
spent_usdgives the share of the would-be cost. - share_
percent - Width (0–100) of a share bar for
valueagainstmax.