summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2021-05-04 13:39:44 +0100
committerGitHub <noreply@github.com>2021-05-04 13:39:44 +0100
commit35c13c730c437896591535db975e392cbd7d2b8e (patch)
treea4e7188025e6c0399062a8769300568f024437cc
parentNewsfile (diff)
downloadsynapse-35c13c730c437896591535db975e392cbd7d2b8e.tar.xz
Apply suggestions from code review
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
-rw-r--r--synapse/metrics/__init__.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/metrics/__init__.py b/synapse/metrics/__init__.py
index 13be0b9b96..dee12cbc49 100644
--- a/synapse/metrics/__init__.py
+++ b/synapse/metrics/__init__.py
@@ -615,8 +615,8 @@ def _setup_jemalloc_stats():
     regex = re.compile(r"/\S+/libjemalloc.*$")
 
     jemalloc_path = None
-    with open(f"/proc/{pid}/maps") as f:
-        for line in f.readlines():
+    with open("/proc/self/maps") as f:
+        for line in f:
             match = regex.search(line.strip())
             if match:
                 jemalloc_path = match.group()
@@ -709,7 +709,7 @@ def _setup_jemalloc_stats():
             _jemalloc_refresh_stats()
 
             g = GaugeMetricFamily(
-                "jemalloc_stats_app_memory",
+                "jemalloc_stats_app_memory_bytes",
                 "The stats reported by jemalloc",
                 labels=["type"],
             )