proxy_logging: remove unnecessary condition

metric_name is always truthy so the condition was unnecessary. This
has been more obvious since the Related-Change.

Change-Id: Ic0877781ff9f52de98c2e892cd4c1d6296dc8073
Related-Change: I25f91b1943b91c7429219c3b5a4280abe9bef5b3
This commit is contained in:
Alistair Coles
2025-03-20 13:58:33 +00:00
parent 769e482ea8
commit 11257eda5a

View File

@@ -333,14 +333,10 @@ class ProxyLoggingMiddleware(object):
metric_name_policy = self.statsd_metric_name_policy(req, status_int,
method,
policy_index)
# Only log data for valid controllers (or SOS) to keep the metric count
# down (egregious errors will get logged by the proxy server itself).
if metric_name:
self.access_logger.timing(metric_name + '.timing',
(end_time - start_time) * 1000)
self.access_logger.update_stats(metric_name + '.xfer',
bytes_received + bytes_sent)
self.access_logger.timing(metric_name + '.timing',
(end_time - start_time) * 1000)
self.access_logger.update_stats(metric_name + '.xfer',
bytes_received + bytes_sent)
if metric_name_policy:
self.access_logger.timing(metric_name_policy + '.timing',
(end_time - start_time) * 1000)