Open kakkoyun opened 1 year ago
@nqv I could be creating an XY-problem https://xyproblem.info/
I want to reiterate. I want to expose a metric to show the current cache sizes of various caches we use. I would be glad if you have a better solution proposal.
Hey π I'm a keen user of the library. Thanks a lot for the work. It's a fantastic package. Simple and functional.
I recently had a use case where I'd like to keep track of the cache size. I think it's doable with minimal change to the
StatsCounter
interface and stats.I don't know if the size calculation should be left to the interface's implementer or handled by the caching layer. I'd love to hear your opinion on it @nqv
It could also be achieved if the withInsertionListener is public https://github.com/goburrow/cache/blob/f6da914dd6e3546dffa8802919dbca80cd33abe3/local.go#L575-L576
I would be happy to work if you're willing to accept my contribution.