From 11257eda5a1ee16c3d8143d1f21f9a3e99590e12 Mon Sep 17 00:00:00 2001 From: Alistair Coles Date: Thu, 20 Mar 2025 13:58:33 +0000 Subject: [PATCH] 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 --- swift/common/middleware/proxy_logging.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/swift/common/middleware/proxy_logging.py b/swift/common/middleware/proxy_logging.py index f4d2bc6ff9..d0421af249 100644 --- a/swift/common/middleware/proxy_logging.py +++ b/swift/common/middleware/proxy_logging.py @@ -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)