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

Method KeyMetadata

bigcache.go:220–224  ·  view source on GitHub ↗

KeyMetadata returns number of times a cached resource was requested.

(key string)

Source from the content-addressed store, hash-verified

218
219// KeyMetadata returns number of times a cached resource was requested.
220func (c *BigCache) KeyMetadata(key string) Metadata {
221 hashedKey := c.hash.Sum64(key)
222 shard := c.getShard(hashedKey)
223 return shard.getKeyMetadataWithLock(hashedKey)
224}
225
226// Iterator returns iterator function to iterate over EntryInfo's from whole cache.
227func (c *BigCache) Iterator() *EntryInfoIterator {

Callers 2

TestCacheEntryStatsFunction · 0.80

Calls 3

getShardMethod · 0.95
Sum64Method · 0.65

Tested by 2

TestCacheEntryStatsFunction · 0.64