EntriesWithPinCount returns the number of pinned and unpinned entries in the cache Each entry is counted only once, regardless of entry.pinCount
()
| 265 | // |
| 266 | // Each entry is counted only once, regardless of entry.pinCount |
| 267 | func (c *Cache) EntriesWithPinCount() (pinned, unpinned int) { |
| 268 | c.mu.Lock() |
| 269 | for _, entry := range c.cache { |
| 270 | if entry.pinCount <= 0 { |
| 271 | unpinned++ |
| 272 | } else { |
| 273 | pinned++ |
| 274 | } |
| 275 | } |
| 276 | c.mu.Unlock() |
| 277 | return pinned, unpinned |
| 278 | } |
no test coverage detected