You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Added
DayKey, the daily counterpart to WeekKey and MonthKey.
AgentUsageBucketKey, the day/provider/agent/purpose/model bucket a daily usage row accumulates under.
AgentSessionUsageRecorded now carries a precomputed DayKey and DailyBucketKey, for the reason its own remarks already give for WeekKey/MonthKey: Chronicle's model-bound key resolution keys a projection on a single event property, so a composite bucket has nowhere else to come from.
UsagePeriod now carries the resolved Day and DailyBucket alongside Week and Month.
Breaking
AgentSessionUsageRecorded and UsagePeriod gained required positional parameters. Code constructing either directly must supply them; RecordAgentSessionUsage.Provide resolves them for the normal path.
AgentUsageByDay's shape and the signature of AgentUsageByDay.LastYear changed as described above.
Changed
AgentUsageByDay is now a real accumulating projection instead of a [Passive] read model. It previously recomputed a year of buckets with an in-memory GroupBy over every session recorded in the trailing 371-day window on every read, a cost that grows without bound with the number of sessions to answer a question whose answer only changes by one session at a time. AgentUsageByWeek and AgentUsageByMonth were already real projections; the daily model is now keyed and accumulated the same way.
AgentUsageByDay.LastYear now reads the accumulated buckets from its own collection and takes an IMongoCollection<AgentUsageByDay> and a TimeProvider, replacing the previous IRecordedAgentSessions parameter.
AgentUsageByDay now exposes the day as a DayKey and carries BucketKey, CachedTokens and DurationMs; total session time remains available as the Duration property.