CacheStats returns stats about the provided cache within the group.
(which CacheType)
| 384 | |
| 385 | // CacheStats returns stats about the provided cache within the group. |
| 386 | func (g *Group) CacheStats(which CacheType) CacheStats { |
| 387 | switch which { |
| 388 | case MainCache: |
| 389 | return g.mainCache.stats() |
| 390 | case HotCache: |
| 391 | return g.hotCache.stats() |
| 392 | default: |
| 393 | return CacheStats{} |
| 394 | } |
| 395 | } |
| 396 | |
| 397 | // cache is a wrapper around an *lru.Cache that adds synchronization, |
| 398 | // makes values always be ByteView, and counts the size of all keys and |