Remove plans/ directory (P0/P1/P2 work complete)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package adaptive
|
||||
|
||||
// Package adaptive: experimental / not yet active after P1-04 prune.
|
||||
// Retained for potential P2 integration. Not used at runtime (pruned from steamcache).
|
||||
// Package adaptive: experimental workload analyzer and adaptive cache manager.
|
||||
// Not active at runtime (pruned from the main request path in earlier hardening work).
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -40,6 +40,7 @@ type WorkloadAnalyzer struct {
|
||||
analysisInterval time.Duration
|
||||
ctx context.Context
|
||||
cancel context.CancelFunc
|
||||
wg sync.WaitGroup
|
||||
}
|
||||
|
||||
// AccessInfo tracks access patterns for individual files
|
||||
@@ -74,6 +75,7 @@ func NewWorkloadAnalyzer(analysisInterval time.Duration) *WorkloadAnalyzer {
|
||||
cancel: cancel,
|
||||
}
|
||||
|
||||
analyzer.wg.Add(1)
|
||||
// Start background analysis with much longer interval to reduce overhead
|
||||
go analyzer.analyzePatterns()
|
||||
|
||||
@@ -120,6 +122,7 @@ func (wa *WorkloadAnalyzer) RecordAccess(key string, size int64) {
|
||||
|
||||
// analyzePatterns analyzes access patterns in the background
|
||||
func (wa *WorkloadAnalyzer) analyzePatterns() {
|
||||
defer wa.wg.Done()
|
||||
ticker := time.NewTicker(wa.analysisInterval)
|
||||
defer ticker.Stop()
|
||||
|
||||
@@ -218,6 +221,7 @@ func (wa *WorkloadAnalyzer) GetAccessInfo(key string) *AccessInfo {
|
||||
// Stop stops the workload analyzer
|
||||
func (wa *WorkloadAnalyzer) Stop() {
|
||||
wa.cancel()
|
||||
wa.wg.Wait()
|
||||
}
|
||||
|
||||
// NewAdaptiveCacheManager creates a new adaptive cache manager
|
||||
|
||||
Reference in New Issue
Block a user