summary refs log tree commit diff
path: root/synapse/metrics
diff options
context:
space:
mode:
authorAmber Brown <hawkowl@atleastfornow.net>2019-09-13 02:29:55 +1000
committerGitHub <noreply@github.com>2019-09-13 02:29:55 +1000
commitb617864cd9f81109e818bc5ae95bee317d917b72 (patch)
tree5bf6d0ee398731dc14ec73ac778ecaba98d0d3fb /synapse/metrics
parentRemove the cap on federation retry interval. (#6026) (diff)
downloadsynapse-b617864cd9f81109e818bc5ae95bee317d917b72.tar.xz
Fix for structured logging tests stomping on logs (#6023)
Diffstat (limited to 'synapse/metrics')
-rw-r--r--synapse/metrics/__init__.py5
-rw-r--r--synapse/metrics/_exposition.py4
2 files changed, 5 insertions, 4 deletions
diff --git a/synapse/metrics/__init__.py b/synapse/metrics/__init__.py
index b5c9595cb9..bec3b13397 100644
--- a/synapse/metrics/__init__.py
+++ b/synapse/metrics/__init__.py
@@ -20,6 +20,7 @@ import os
 import platform
 import threading
 import time
+from typing import Dict, Union
 
 import six
 
@@ -42,9 +43,7 @@ logger = logging.getLogger(__name__)
 METRICS_PREFIX = "/_synapse/metrics"
 
 running_on_pypy = platform.python_implementation() == "PyPy"
-all_metrics = []
-all_collectors = []
-all_gauges = {}
+all_gauges = {}  # type: Dict[str, Union[LaterGauge, InFlightGauge, BucketCollector]]
 
 HAVE_PROC_SELF_STAT = os.path.exists("/proc/self/stat")
 
diff --git a/synapse/metrics/_exposition.py b/synapse/metrics/_exposition.py
index 1933ecd3e3..74d9c3ecd3 100644
--- a/synapse/metrics/_exposition.py
+++ b/synapse/metrics/_exposition.py
@@ -36,7 +36,9 @@ from twisted.web.resource import Resource
 try:
     from prometheus_client.samples import Sample
 except ImportError:
-    Sample = namedtuple("Sample", ["name", "labels", "value", "timestamp", "exemplar"])
+    Sample = namedtuple(
+        "Sample", ["name", "labels", "value", "timestamp", "exemplar"]
+    )  # type: ignore
 
 
 CONTENT_TYPE_LATEST = str("text/plain; version=0.0.4; charset=utf-8")