Metrics returns a snapshot of the cache performance counters. This is not safe for concurrent use by multiple goroutines.
()
| 357 | // |
| 358 | // This is not safe for concurrent use by multiple goroutines. |
| 359 | func (c *BufferCache) Metrics() Metrics { |
| 360 | m := Metrics{} |
| 361 | |
| 362 | m.Hot.TotalEntries = uint64(len(c.hot.m)) |
| 363 | m.Hot.TotalSize = uint64(c.hot.cap) |
| 364 | m.Cold = *c.cold.metrics() |
| 365 | m.TotalFlushes = c.nflushes |
| 366 | return m |
| 367 | } |