ccache
ccache copied to clipboard
Statistics/metrics reporting
For longer running caches it is critically important to be able to obtain operational metrics - number of cached items, rate of eviction, possibly some internal statistics. All decent caches thus provide a method to unintrusively obtain those in run-time.
Ccache should have something like that to be trusted in most production settings.
I think you're right, but I haven't done Go in a while and don't have time to tackle this. I might come back to Go if generics are added. I'd be willing to review and merge a PR, but I think a better solution might be to wrap the calls into a statistics tracker which does what you want; although I realize you'll be limited in what you can track without access to internals.
FWIW, while I still like ccache's core lru implementation, I think it grew too fat, trying to do too much. Layered caching, tracking, ... blah.
What a pity.
Whatever the shortcomings may be, ccache is the most decent cache available in Go. Alas, the alternatives are barely usable, feature-wise.
I know it's late. But you can now use GetDropped
to get the rate of eviction. Will keep this open since there's obviously more that could be done.