MetricCacheEntry class
A cached metric computation result.
Constructors
-
MetricCacheEntry({required String cacheKey, required MetricComputeResult value, required DateTime computedAt, required DateTime expiresAt, required CacheLevel level, String? runId, String? contextId, String? snapshotHash, String validationStatus = 'valid', int hitCount = 0, DateTime? lastHitAt, List<
String> dependentMetrics = const []}) -
const
Properties
- cacheKey → String
-
Cache key.
final
- computedAt → DateTime
-
When the result was computed.
final
- contextId → String?
-
Context ID for this entry.
final
-
dependentMetrics
→ List<
String> -
Metrics that depend on this metric (for cascade invalidation).
final
- expiresAt → DateTime
-
When this entry expires.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hitCount → int
-
Number of cache hits.
final
- isExpired → bool
-
Whether this entry has expired.
no setter
- isValid → bool
-
Whether this entry is valid (not expired and validation status is valid).
no setter
- lastHitAt → DateTime?
-
Last time this entry was hit.
final
- level → CacheLevel
-
Cache level this entry belongs to.
final
- runId → String?
-
Run ID that produced this entry.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- snapshotHash → String?
-
Fact bundle hash for this entry.
final
- validationStatus → String
-
Validation status: 'valid', 'stale', 'invalidated'.
final
- value → MetricComputeResult
-
Cached result.
final
Methods
-
copyWith(
{CacheLevel? level, DateTime? expiresAt, String? validationStatus, int? hitCount, DateTime? lastHitAt}) → MetricCacheEntry - Create a copy with different level/expiry.
-
isFreshFor(
ProfileContext context) → bool - Check if cache entry is still fresh for given context.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited