Move TRACK_MEMORY_USAGE to root

This commit is contained in:
Erik Johnston 2021-04-26 10:50:15 +01:00
parent 567fe5e387
commit 99fb72e63e
2 changed files with 6 additions and 5 deletions

View file

@ -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]

View file

@ -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])