cache is a wrapper around an *lru.Cache that adds synchronization, makes values always be ByteView, and counts the size of all keys and values.
| 398 | // makes values always be ByteView, and counts the size of all keys and |
| 399 | // values. |
| 400 | type cache struct { |
| 401 | mu sync.RWMutex |
| 402 | nbytes int64 // of all keys and values |
| 403 | lru *lru.Cache |
| 404 | nhit, nget int64 |
| 405 | nevict int64 // number of evictions |
| 406 | } |
| 407 | |
| 408 | func (c *cache) stats() CacheStats { |
| 409 | c.mu.RLock() |
nothing calls this directly
no outgoing calls
no test coverage detected