From 35c13c730c437896591535db975e392cbd7d2b8e Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Tue, 4 May 2021 13:39:44 +0100 Subject: Apply suggestions from code review Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> --- synapse/metrics/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'synapse') 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"], ) -- cgit 1.5.1