diff options
author | Erik Johnston <erik@matrix.org> | 2022-07-19 10:26:26 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2022-07-19 10:26:26 +0100 |
commit | 420276743465c64d9af9671fcbaa0b85e165ba81 (patch) | |
tree | deb7ada2ea807e8e69adff8da9bb7d94478d42b6 /synapse | |
parent | Fix metrics (diff) | |
download | synapse-erikj/bloom_doorkeeper.tar.xz |
Better metrics github/erikj/bloom_doorkeeper erikj/bloom_doorkeeper
Diffstat (limited to 'synapse')
-rw-r--r-- | synapse/util/caches/lrucache.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/synapse/util/caches/lrucache.py b/synapse/util/caches/lrucache.py index dd80168c0d..0b864129ad 100644 --- a/synapse/util/caches/lrucache.py +++ b/synapse/util/caches/lrucache.py @@ -434,16 +434,14 @@ class LruCache(Generic[KT, VT]): else: self.max_size = int(max_size) - self._doorkeeper = ScalableCuckooFilter( - initial_capacity=self.max_size, error_rate=0.001 - ) - self._doorkeeper_2 = ScalableCuckooFilter(self.max_size, 0.001) + self._doorkeeper = ScalableCuckooFilter(100, 0.001) + self._doorkeeper_2 = ScalableCuckooFilter(100, 0.001) def _rotate_doorkeeper() -> None: self._doorkeeper_2 = self._doorkeeper - self._doorkeeper = ScalableCuckooFilter(self.max_size, 0.001) + self._doorkeeper = ScalableCuckooFilter(100, 0.001) - real_clock.looping_call(_rotate_doorkeeper, 5 * 60 * 100) + real_clock.looping_call(_rotate_doorkeeper, 60 * 100) # register_cache might call our "set_cache_factor" callback; there's nothing to # do yet when we get resized. @@ -456,6 +454,8 @@ class LruCache(Generic[KT, VT]): self, collect_callback=metrics_collection_callback, ) + doorkeeper_counter.labels(cache_name) + doorkeeper_hit_counter.labels(cache_name) else: metrics = None |