1
0
Fork 0
mirror of https://github.com/imjasonh/snoop synced 2026-07-14 11:26:16 +00:00
snoop/pkg/metrics
Jason Hall b3f7c96343 Add memory-bounded deduplication with LRU cache
Implements configurable memory limits for the file deduplication cache
to prevent unbounded memory growth in long-running production deployments.

- Add LRU cache implementation with configurable max size
- Add -max-unique-files flag (default: 0 = unbounded)
- Add snoop_events_evicted_total metric for monitoring
- Track and log cache evictions with delta warnings
- Add comprehensive tests for bounded and unbounded behavior

When max-unique-files is set, the cache evicts least-recently-used
entries to stay within the limit. Evicted files may be re-recorded
if accessed again, making this suitable for workloads with temporal
locality in file access patterns.

Closes milestone 3 task: Memory-bounded deduplication

Signed-off-by: Jason Hall <jason@chainguard.dev>
2026-01-14 10:44:04 -05:00
..
metrics.go Add memory-bounded deduplication with LRU cache 2026-01-14 10:44:04 -05:00
metrics_test.go Add Prometheus metrics endpoint for production observability 2026-01-14 10:21:17 -05:00