PersistedStatsCache class
Persisted stats cache stored on disk. Contains aggregated historical stats that won't change. All fields are bounded to prevent unbounded file growth.
Constructors
-
PersistedStatsCache({int version = statsCacheVersion, String? lastComputedDate, List<
DailyActivity> dailyActivity = const [], List<DailyModelTokens> dailyModelTokens = const [], Map<String, ModelUsage> modelUsage = const {}, int totalSessions = 0, int totalMessages = 0, SessionStats? longestSession, String? firstSessionDate, Map<int, int> hourCounts = const {}, int totalSpeculationTimeSavedMs = 0, Map<int, int> ? shotDistribution}) -
PersistedStatsCache.fromJson(Map<
String, dynamic> json) -
factory
Properties
-
dailyActivity
→ List<
DailyActivity> -
Daily aggregates needed for heatmap, streaks, trends (bounded by days).
final
-
dailyModelTokens
→ List<
DailyModelTokens> -
final
- firstSessionDate → String?
-
First session date ever recorded.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
hourCounts
→ Map<
int, int> -
Hour counts for peak hour calculation (bounded to 24 entries).
final
- lastComputedDate → String?
-
Last date that was fully computed (YYYY-MM-DD format).
Stats up to and including this date are considered complete.
final
- longestSession → SessionStats?
-
final
-
modelUsage
→ Map<
String, ModelUsage> -
Model usage aggregated (bounded by number of models).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
shotDistribution
→ Map<
int, int> ? -
Shot distribution: map of shot count -> number of sessions (ant-only).
final
- totalMessages → int
-
final
- totalSessions → int
-
Session aggregates (replaces unbounded sessionStats array).
final
- totalSpeculationTimeSavedMs → int
-
Speculation time saved across all sessions.
final
- version → int
-
final
Methods
-
copyWith(
{int? version, String? lastComputedDate, List< DailyActivity> ? dailyActivity, List<DailyModelTokens> ? dailyModelTokens, Map<String, ModelUsage> ? modelUsage, int? totalSessions, int? totalMessages, SessionStats? longestSession, String? firstSessionDate, Map<int, int> ? hourCounts, int? totalSpeculationTimeSavedMs, Map<int, int> ? shotDistribution}) → PersistedStatsCache -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited