MCPcopy Index your code
hub / github.com/cortexproject/cortex / FifoCache

Struct FifoCache

pkg/chunk/cache/fifo_cache.go:67–85  ·  view source on GitHub ↗

FifoCache is a simple string -> interface{} cache which uses a fifo slide to manage evictions. O(1) inserts and updates, O(1) gets.

Source from the content-addressed store, hash-verified

65// FifoCache is a simple string -> interface{} cache which uses a fifo slide to
66// manage evictions. O(1) inserts and updates, O(1) gets.
67type FifoCache struct {
68 lock sync.RWMutex
69 maxSizeItems int
70 maxSizeBytes uint64
71 currSizeBytes uint64
72 validity time.Duration
73
74 entries map[string]*list.Element
75 lru *list.List
76
77 entriesAdded prometheus.Counter
78 entriesAddedNew prometheus.Counter
79 entriesEvicted prometheus.Counter
80 entriesCurrent prometheus.Gauge
81 totalGets prometheus.Counter
82 totalMisses prometheus.Counter
83 staleGets prometheus.Counter
84 memoryBytes prometheus.Gauge
85}
86
87type cacheEntry struct {
88 updated time.Time

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected