5b9edc7702bc197b090e9f9b2013949a67ec70d2
Add data layer support for real-time usage visualization: - MinuteStats type: holds token counts for 5-minute buckets, enabling granular recent-activity views (12 buckets covering the last hour). - AggregateTodayHourly(): computes 24 hourly token buckets for the current local day by filtering sessions to today's date boundary and slotting each into the correct hour index. Tracks prompts, sessions, and total tokens per hour. - AggregateLastHour(): computes 12 five-minute token buckets for the last 60 minutes using reverse-offset bucketing (bucket 11 = most recent 5 minutes, bucket 0 = 55-60 minutes ago). Bounds-clamped to prevent off-by-one at the edges. Both functions filter on StartTime locality and skip zero-time sessions, consistent with existing aggregation patterns in the pipeline package. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Description
No description provided
Languages
Go
99.8%
Makefile
0.2%