mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 10:06:05 -04:00
Add prometheus metrics for the number of active pushers (#7103)
This commit is contained in:
parent
443162e577
commit
8c75667ad7
5 changed files with 36 additions and 8 deletions
|
@ -17,6 +17,7 @@ import logging
|
|||
import threading
|
||||
from asyncio import iscoroutine
|
||||
from functools import wraps
|
||||
from typing import Dict, Set
|
||||
|
||||
import six
|
||||
|
||||
|
@ -80,13 +81,13 @@ _background_process_db_sched_duration = Counter(
|
|||
# map from description to a counter, so that we can name our logcontexts
|
||||
# incrementally. (It actually duplicates _background_process_start_count, but
|
||||
# it's much simpler to do so than to try to combine them.)
|
||||
_background_process_counts = {} # type: dict[str, int]
|
||||
_background_process_counts = {} # type: Dict[str, int]
|
||||
|
||||
# map from description to the currently running background processes.
|
||||
#
|
||||
# it's kept as a dict of sets rather than a big set so that we can keep track
|
||||
# of process descriptions that no longer have any active processes.
|
||||
_background_processes = {} # type: dict[str, set[_BackgroundProcess]]
|
||||
_background_processes = {} # type: Dict[str, Set[_BackgroundProcess]]
|
||||
|
||||
# A lock that covers the above dicts
|
||||
_bg_metrics_lock = threading.Lock()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue