MCPcopy Create free account
hub / github.com/allegro/bigcache / Stats

Method Stats

bigcache.go:206–217  ·  view source on GitHub ↗

Stats returns cache's statistics

()

Source from the content-addressed store, hash-verified

204
205// Stats returns cache's statistics
206func (c *BigCache) Stats() Stats {
207 var s Stats
208 for _, shard := range c.shards {
209 tmp := shard.getStats()
210 s.Hits += tmp.Hits
211 s.Misses += tmp.Misses
212 s.DelHits += tmp.DelHits
213 s.DelMisses += tmp.DelMisses
214 s.Collisions += tmp.Collisions
215 }
216 return s
217}
218
219// KeyMetadata returns number of times a cached resource was requested.
220func (c *BigCache) KeyMetadata(key string) Metadata {

Callers 8

TestAppendCollisionFunction · 0.80
TestCacheStatsFunction · 0.80
TestCacheRestStatsFunction · 0.80
TestHashCollisionFunction · 0.80
TestEntryNotPresentFunction · 0.80
getCacheStatsHandlerFunction · 0.80

Calls 1

getStatsMethod · 0.80

Tested by 7

TestAppendCollisionFunction · 0.64
TestCacheStatsFunction · 0.64
TestCacheRestStatsFunction · 0.64
TestHashCollisionFunction · 0.64
TestEntryNotPresentFunction · 0.64