diff options
author | David Robertson <davidr@element.io> | 2022-05-12 15:33:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-12 14:33:50 +0000 |
commit | 17e1eb7749adf12d43f534c50115bbe19c809ea6 (patch) | |
tree | b2e3e373a22432dbafe5a9e65abb98900fa3bb5d /synapse/http/request_metrics.py | |
parent | add default_power_level_content_override config option. (#12618) (diff) | |
download | synapse-17e1eb7749adf12d43f534c50115bbe19c809ea6.tar.xz |
Reduce the number of "untyped defs" (#12716)
Diffstat (limited to 'synapse/http/request_metrics.py')
-rw-r--r-- | synapse/http/request_metrics.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/synapse/http/request_metrics.py b/synapse/http/request_metrics.py index 4886626d50..2b6d113544 100644 --- a/synapse/http/request_metrics.py +++ b/synapse/http/request_metrics.py @@ -162,7 +162,7 @@ class RequestMetrics: with _in_flight_requests_lock: _in_flight_requests.add(self) - def stop(self, time_sec, response_code, sent_bytes): + def stop(self, time_sec: float, response_code: int, sent_bytes: int) -> None: with _in_flight_requests_lock: _in_flight_requests.discard(self) @@ -186,13 +186,13 @@ class RequestMetrics: ) return - response_code = str(response_code) + response_code_str = str(response_code) - outgoing_responses_counter.labels(self.method, response_code).inc() + outgoing_responses_counter.labels(self.method, response_code_str).inc() response_count.labels(self.method, self.name, tag).inc() - response_timer.labels(self.method, self.name, tag, response_code).observe( + response_timer.labels(self.method, self.name, tag, response_code_str).observe( time_sec - self.start_ts ) @@ -221,7 +221,7 @@ class RequestMetrics: # flight. self.update_metrics() - def update_metrics(self): + def update_metrics(self) -> None: """Updates the in flight metrics with values from this request.""" if not self.start_context: logger.error( |