[AIDE-122] Usage Updates - #95
Merged
Merged
Conversation
Add a spendPeaks GraphQL resolver that reports the highest 7-day and 30-day spend windows across retained usage, honoring history, agent, and model filters. Surface the peaks as spend record tiles on the usage page and let bounded ranges select an inclusive end date via a calendar picker with strict YYYY-MM-DD validation. Refresh spend records when filters change without recollecting.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Enhances the usage dashboard with spend records and a configurable usage end date. The page now shows "Spend records" tiles with the highest 7-day and 30-day spend windows across all retained usage, and a calendar date picker that lets users bound the rolling ranges to a specific end date instead of always ending today.
Changes
spendPeaksGraphQL field returning the highest rolling 7-day and 30-day spend windows (CcusageSpendWindow/CcusageSpendPeaks), computed across all retained dates while honoring history, agent, and model filters.endDateargument to theaggregatequery field so bounded ranges (7/30 days) use a specific inclusive end date instead of today; ignored forALLand validated as strictYYYY-MM-DD.ALLtoLAST_30_DAYSso spend records are visible by default.highestUsageSpendWindow,usageSpendPeaks,filterUsageByModel,usagePeriodForDate,usagePeriodToDate) and extendedfilterUsageByDayswith an upper date bound; peaks tie-break to the latest window.Ticket: AIDE-122