MCPcopy Create free account
hub / github.com/cortexproject/cortex / Stop

Method Stop

pkg/chunk/cache/fifo_cache.go:209–221  ·  view source on GitHub ↗

Stop implements Cache.

()

Source from the content-addressed store, hash-verified

207
208// Stop implements Cache.
209func (c *FifoCache) Stop() {
210 c.lock.Lock()
211 defer c.lock.Unlock()
212
213 c.entriesEvicted.Add(float64(c.lru.Len()))
214
215 c.entries = make(map[string]*list.Element)
216 c.lru.Init()
217 c.currSizeBytes = 0
218
219 c.entriesCurrent.Set(float64(0))
220 c.memoryBytes.Set(float64(0))
221}
222
223func (c *FifoCache) put(key string, value []byte) {
224 // See if we already have the item in the cache.

Callers 2

TestFifoCacheEvictionFunction · 0.95
TestFifoCacheExpiryFunction · 0.95

Calls 3

SetMethod · 0.65
AddMethod · 0.45
LenMethod · 0.45

Tested by 2

TestFifoCacheEvictionFunction · 0.76
TestFifoCacheExpiryFunction · 0.76