summary refs log tree commit diff
path: root/synapse/util/caches/expiringcache.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Use inline type hints in `http/federation/`, `storage/` and `util/` (#10381)Jonathan de Jong2021-07-151-2/+2
|
* Remove redundant "coding: utf-8" lines (#9786)Jonathan de Jong2021-04-141-1/+0
| | | | | | | Part of #9744 Removes all redundant `# -*- coding: utf-8 -*-` lines from files, as python 3 automatically reads source code as utf-8 now. `Signed-off-by: Jonathan de Jong <jonathan@automatia.nl>`
* Add type hints to expiring cache. (#9730)Patrick Cloke2021-04-061-32/+51
|
* Stop sub-classing object (#8249)Patrick Cloke2020-09-041-2/+2
|
* Replace iteritems/itervalues/iterkeys with native versions. (#7692)Patrick Cloke2020-06-151-4/+2
|
* Allow configuration of Synapse's cache without using synctl or environment ↵Amber Brown2020-05-111-4/+25
| | | | variables (#6391)
* Run Black. (#5482)Amber Brown2019-06-201-5/+13
|
* Correctly match 'dict.pop' apiErik Johnston2018-10-011-3/+11
|
* Don't update eviction metrics on explicit removalErik Johnston2018-10-011-5/+0
|
* Fix ExpiringCache.__len__ to be accurateErik Johnston2018-09-211-12/+9
| | | | | | 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.
* Add a five minute cache to get_destination_retry_timingsErik Johnston2018-09-211-0/+13
| | | | Hopefully helps with #3931
* Make ExpiringCache slightly more performantErik Johnston2018-09-211-1/+5
|
* Fix some instances of ExpiringCache not expiring cache itemsErik Johnston2018-09-211-1/+0
| | | | | | | | ExpiringCache required that `start()` be called before it would actually start expiring entries. A number of places didn't do that. This PR removes `start` from ExpiringCache, and automatically starts backround reaping process on creation instead.
* Fix some looping_call calls which were broken in #3604Richard van der Hoff2018-07-261-1/+1
| | | | | | | | | It turns out that looping_call does check the deferred returned by its callback, and (at least in the case of client_ips), we were relying on this, and I broke it in #3604. Update run_as_background_process to return the deferred, and make sure we return it to clock.looping_call.
* Run things as background processesRichard van der Hoff2018-07-181-1/+5
| | | | | | | | This fixes #3518, and ensures that we get useful logs and metrics for lots of things that happen in the background. (There are certainly more things that happen in the background; these are just the common ones I've found running a single-process synapse locally).
* run isortAmber Brown2018-07-091-3/+2
|
* replacing portionsAmber Brown2018-05-211-2/+2
|
* report metrics on number of cache evictionsRichard van der Hoff2018-02-051-1/+5
|
* Use an ExpiringCache for storing registration sessionsErik Johnston2017-06-291-0/+3
| | | | | This is because pruning them was a significant performance drain on matrix.org
* Add setdefault key to ExpiringCacheErik Johnston2017-03-101-0/+7
|
* Speed up cache size calculationErik Johnston2017-01-171-3/+12
| | | | | | | | | | | Instead of calculating the size of the cache repeatedly, which can take a long time now that it can use a callback, instead cache the size and update that on insertion and deletion. This requires changing the cache descriptors to have two caches, one for pending deferreds and the other for the actual values. There's no reason to evict from the pending deferreds as they won't take up any more memory.
* Use OrderedDict in ExpiringCacheErik Johnston2017-01-161-10/+4
|
* Add support for 'iterable' to ExpiringCacheErik Johnston2017-01-161-9/+17
|
* Change CacheMetrics to be quickerErik Johnston2016-06-031-4/+4
| | | | | | We change it so that each cache has an individual CacheMetric, instead of having one global CacheMetric. This means that when a cache tries to increment a counter it does not need to go through so many indirections.
* Use syntax that works on both py2.7 and py3Mark Haines2016-03-071-1/+1
|
* Reraise exceptionErik Johnston2016-03-011-0/+1
|
* Correct cache miss detectionErik Johnston2016-03-011-1/+1
|
* Report size of ExpiringCacheErik Johnston2016-02-231-2/+13
|
* Fix flake8 warnings for new flake8Daniel Wagner-Hall2016-02-021-1/+1
|
* copyrightsMatthew Hodgson2016-01-071-1/+1
|
* Move all the caches into their own package, synapse.util.cachesErik Johnston2015-08-111-0/+115