summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--synapse/util/caches/__init__.py5
-rw-r--r--synapse/util/caches/lrucache.py6
2 files changed, 6 insertions, 5 deletions
diff --git a/synapse/util/caches/__init__.py b/synapse/util/caches/__init__.py

index 8e253cb518..b2504c2fad 100644 --- a/synapse/util/caches/__init__.py +++ b/synapse/util/caches/__init__.py
@@ -24,6 +24,11 @@ from synapse.config.cache import add_resizable_cache logger = logging.getLogger(__name__) + +# Whether to track estimated memory usage of the LruCaches. +TRACK_MEMORY_USAGE = False + + caches_by_name = {} # type: Dict[str, Sized] collectors_by_name = {} # type: Dict[str, CacheMetric] diff --git a/synapse/util/caches/lrucache.py b/synapse/util/caches/lrucache.py
index 1719b0a1ca..5fc26cedd2 100644 --- a/synapse/util/caches/lrucache.py +++ b/synapse/util/caches/lrucache.py
@@ -30,7 +30,7 @@ from typing import ( from typing_extensions import Literal from synapse.config import cache as cache_config -from synapse.util.caches import CacheMetric, register_cache +from synapse.util.caches import TRACK_MEMORY_USAGE, CacheMetric, register_cache from synapse.util.caches.treecache import TreeCache try: @@ -59,10 +59,6 @@ except ImportError: return 0 -# Whether to track estimated memory usage of the LruCaches. -TRACK_MEMORY_USAGE = False - - # Function type: the type used for invalidation callbacks FT = TypeVar("FT", bound=Callable[..., Any])