summary refs log tree commit diff
path: root/synapse/util
diff options
context:
space:
mode:
authorAmber Brown <hawkowl@atleastfornow.net>2018-05-28 19:14:41 +1000
committerAmber Brown <hawkowl@atleastfornow.net>2018-05-28 19:14:41 +1000
commit357c74a50f1e1588a6a3d626bddb3555452c6f56 (patch)
treec6fbadc5b553e8faa41f7c1be9c84790969b4a09 /synapse/util
parentupdate metrics to be in seconds (diff)
downloadsynapse-357c74a50f1e1588a6a3d626bddb3555452c6f56.tar.xz
add comment about why unreg
Diffstat (limited to 'synapse/util')
-rw-r--r--synapse/util/caches/__init__.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/synapse/util/caches/__init__.py b/synapse/util/caches/__init__.py
index d968b71e7a..183faf75a1 100644
--- a/synapse/util/caches/__init__.py
+++ b/synapse/util/caches/__init__.py
@@ -41,6 +41,8 @@ response_cache_total = Gauge("synapse_util_caches_response_cache:total", "", ["n
 def register_cache(cache_type, cache_name, cache):
 
     # Check if the metric is already registered. Unregister it, if so.
+    # This usually happens during tests, as at runtime these caches are
+    # effectively singletons.
     metric_name = "cache_%s_%s" % (cache_type, cache_name)
     if metric_name in collectors_by_name.keys():
         REGISTRY.unregister(collectors_by_name[metric_name])