diff options
author | Brendan Abolivier <babolivier@matrix.org> | 2021-11-25 15:16:47 +0000 |
---|---|---|
committer | Brendan Abolivier <babolivier@matrix.org> | 2021-11-25 15:16:47 +0000 |
commit | cb79a2b78546ffcecc6b8fad6664535c8dbf4aec (patch) | |
tree | 104072b132e9d415d2d6fdd388629bc75d02b402 /synapse/metrics/jemalloc.py | |
parent | Prevent the media store from writing outside of the configured directory (diff) | |
parent | Improve performance of `remove_{hidden,deleted}_devices_from_device_inbox` (#... (diff) | |
download | synapse-cb79a2b78546ffcecc6b8fad6664535c8dbf4aec.tar.xz |
Merge branch 'develop' into matrix-org-hotfixes
Diffstat (limited to 'synapse/metrics/jemalloc.py')
-rw-r--r-- | synapse/metrics/jemalloc.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/synapse/metrics/jemalloc.py b/synapse/metrics/jemalloc.py index 29ab6c0229..98ed9c0829 100644 --- a/synapse/metrics/jemalloc.py +++ b/synapse/metrics/jemalloc.py @@ -16,14 +16,16 @@ import ctypes import logging import os import re -from typing import Optional +from typing import Iterable, Optional + +from prometheus_client import Metric from synapse.metrics import REGISTRY, GaugeMetricFamily logger = logging.getLogger(__name__) -def _setup_jemalloc_stats(): +def _setup_jemalloc_stats() -> None: """Checks to see if jemalloc is loaded, and hooks up a collector to record statistics exposed by jemalloc. """ @@ -135,7 +137,7 @@ def _setup_jemalloc_stats(): class JemallocCollector: """Metrics for internal jemalloc stats.""" - def collect(self): + def collect(self) -> Iterable[Metric]: _jemalloc_refresh_stats() g = GaugeMetricFamily( @@ -185,7 +187,7 @@ def _setup_jemalloc_stats(): logger.debug("Added jemalloc stats") -def setup_jemalloc_stats(): +def setup_jemalloc_stats() -> None: """Try to setup jemalloc stats, if jemalloc is loaded.""" try: |