Remove plans/ directory (P0/P1/P2 work complete)

This commit is contained in:
2026-05-27 02:12:21 -05:00
parent 0c1840d223
commit 0dbb2e02ed
33 changed files with 1906 additions and 990 deletions
+13 -5
View File
@@ -77,11 +77,19 @@ func (fi *FileInfo) UpdateAccessBatched(btu *BatchedTimeUpdate) {
fi.AccessCount++
}
// GetTimeDecayedScore calculates a score based on access time and frequency
// More recent and frequent accesses get higher scores
func (fi *FileInfo) GetTimeDecayedScore() float64 {
timeSinceAccess := time.Since(fi.ATime).Hours()
// DecayedScore computes the time-decayed eviction score from scalar snapshot values (aTime, accessCount).
// This is the canonical implementation of the decay formula (shared to eliminate duplication).
// Used by FileInfo.GetTimeDecayedScore and by EvictHybrid (memory/disk) for race-free scoring
// on values captured under RLock.
func DecayedScore(aTime time.Time, accessCount int) float64 {
timeSinceAccess := time.Since(aTime).Hours()
decayFactor := 1.0 / (1.0 + timeSinceAccess/24.0) // Decay over days
frequencyBonus := float64(fi.AccessCount) * 0.1
frequencyBonus := float64(accessCount) * 0.1
return decayFactor + frequencyBonus
}
// GetTimeDecayedScore calculates a score based on access time and frequency
// More recent and frequent accesses get higher scores.
func (fi *FileInfo) GetTimeDecayedScore() float64 {
return DecayedScore(fi.ATime, fi.AccessCount)
}