mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 03:44:52 -04:00
Add most missing type hints to synapse.util (#11328)
This commit is contained in:
parent
3a1462f7e0
commit
7468723697
10 changed files with 161 additions and 165 deletions
|
@ -64,6 +64,13 @@ in_flight = InFlightGauge(
|
|||
sub_metrics=["real_time_max", "real_time_sum"],
|
||||
)
|
||||
|
||||
|
||||
# This is dynamically created in InFlightGauge.__init__.
|
||||
class _InFlightMetric(Protocol):
|
||||
real_time_max: float
|
||||
real_time_sum: float
|
||||
|
||||
|
||||
T = TypeVar("T", bound=Callable[..., Any])
|
||||
|
||||
|
||||
|
@ -180,7 +187,7 @@ class Measure:
|
|||
"""
|
||||
return self._logging_context.get_resource_usage()
|
||||
|
||||
def _update_in_flight(self, metrics) -> None:
|
||||
def _update_in_flight(self, metrics: _InFlightMetric) -> None:
|
||||
"""Gets called when processing in flight metrics"""
|
||||
assert self.start is not None
|
||||
duration = self.clock.time() - self.start
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue