bbangert / beaker

WSGI middleware for sessions and caching
https://beaker.readthedocs.org/
Other
517 stars 147 forks source link

Cache metrics #197

Open masoudsafa opened 3 years ago

masoudsafa commented 3 years ago

hi, im using beaker in a large scale enterprise application. so status of cache is too important . how i could expose cache metrics? for example hit rate, size of cache, number of caches in each namespace and etc.

rankinga commented 3 years ago

I am also looking for the similar feature as provide in lru_cache cache_info(). For the missing count, I currently add two extra line to make it work.

@cache.cache()
def cached_function(para1, para2):
    cached_function.callingcount += 1
    # doing some stuff...
    return ""

cached_function.callingcount = 0
masoudsafa commented 3 years ago

Please add this feature