allegro / allegro/bigcache

[Question]can bigcache add func reset stats

未關閉
#315 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Go
星號
8.2k
分支
614
平均合併
5 天 12 小時
30 天內合併 PR
1

描述

I want to calculate the 10 second cache hit rate, but func Stats() get hit rate is from when cache is init.
can bigcache add func reset stats
for example
```
func (c *BigCache) ResetStats() {
for _, shard := range c.shards {
shard.resetStats()
}
}

func (s *cacheShard) resetStats() {
s.stats = Stats{}
}
```

of course, i can record last Stats and get new Stats after 10 seconds, then use it calc hit rate. but i think add reset stats func can make code more clear

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。