cache
cache copied to clipboard
Add cache hit field in Item
Add cache hit field in Item.
Hello :) I want to record cache metrics with labels when calling Once
function like below
item := &Item{}
if err := cache.Once(item); err != nil {
return err
}
metrics.IncCacheTotal("product")
if item.CacheHit {
metrics.IncCacheHit("product")
}
I found Stats()
function but this function provides only total count of hits and misses :(