mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 03:34:49 -04:00
Add type annotations to synapse.metrics
(#10847)
This commit is contained in:
parent
d993c3bb1e
commit
84fac0f814
12 changed files with 174 additions and 86 deletions
|
@ -56,14 +56,6 @@ block_db_sched_duration = Counter(
|
|||
"synapse_util_metrics_block_db_sched_duration_seconds", "", ["block_name"]
|
||||
)
|
||||
|
||||
# Tracks the number of blocks currently active
|
||||
in_flight = InFlightGauge(
|
||||
"synapse_util_metrics_block_in_flight",
|
||||
"",
|
||||
labels=["block_name"],
|
||||
sub_metrics=["real_time_max", "real_time_sum"],
|
||||
)
|
||||
|
||||
|
||||
# This is dynamically created in InFlightGauge.__init__.
|
||||
class _InFlightMetric(Protocol):
|
||||
|
@ -71,6 +63,15 @@ class _InFlightMetric(Protocol):
|
|||
real_time_sum: float
|
||||
|
||||
|
||||
# Tracks the number of blocks currently active
|
||||
in_flight: InFlightGauge[_InFlightMetric] = InFlightGauge(
|
||||
"synapse_util_metrics_block_in_flight",
|
||||
"",
|
||||
labels=["block_name"],
|
||||
sub_metrics=["real_time_max", "real_time_sum"],
|
||||
)
|
||||
|
||||
|
||||
T = TypeVar("T", bound=Callable[..., Any])
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue