mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-08-03 18:44:12 -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
|
@ -20,7 +20,7 @@ import os
|
|||
import platform
|
||||
import threading
|
||||
import time
|
||||
from typing import Dict, Union
|
||||
from typing import Callable, Dict, Iterable, Optional, Tuple, Union
|
||||
|
||||
import six
|
||||
|
||||
|
@ -59,10 +59,12 @@ class RegistryProxy(object):
|
|||
@attr.s(hash=True)
|
||||
class LaterGauge(object):
|
||||
|
||||
name = attr.ib()
|
||||
desc = attr.ib()
|
||||
labels = attr.ib(hash=False)
|
||||
caller = attr.ib()
|
||||
name = attr.ib(type=str)
|
||||
desc = attr.ib(type=str)
|
||||
labels = attr.ib(hash=False, type=Optional[Iterable[str]])
|
||||
# callback: should either return a value (if there are no labels for this metric),
|
||||
# or dict mapping from a label tuple to a value
|
||||
caller = attr.ib(type=Callable[[], Union[Dict[Tuple[str, ...], float], float]])
|
||||
|
||||
def collect(self):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue