synapse-product/synapse/util/caches
Erik Johnston 3baf6e1667 Fix ExpiringCache.__len__ to be accurate
It used to try and produce an estimate, which was sometimes negative.
This caused metrics to be sad, so lets always just calculate it from
scratch.

(This appears to have been a longstanding bug, but one which has been made more
of a problem by #3932 and #3933).

(This was originally done by Erik as part of #3933. I'm cherry-picking it
because really it's a fix in its own right)
2018-09-26 12:32:29 +01:00
..
__init__.py run isort 2018-07-09 16:09:20 +10:00
descriptors.py Rename async to async_helpers because async is a keyword on Python 3.7 (#3678) 2018-08-10 23:50:21 +10:00
dictionary_cache.py run isort 2018-07-09 16:09:20 +10:00
expiringcache.py Fix ExpiringCache.__len__ to be accurate 2018-09-26 12:32:29 +01:00
lrucache.py run isort 2018-07-09 16:09:20 +10:00
response_cache.py Rename async to async_helpers because async is a keyword on Python 3.7 (#3678) 2018-08-10 23:50:21 +10:00
snapshot_cache.py Rename async to async_helpers because async is a keyword on Python 3.7 (#3678) 2018-08-10 23:50:21 +10:00
stream_change_cache.py Use efficient .intersection 2018-07-17 11:07:04 +01:00
treecache.py Consistently use six's iteritems and wrap lazy keys/values in list() if they're not meant to be lazy (#3307) 2018-05-31 19:03:47 +10:00