From 1ed186108956a1f7cc5fe34dc9d93731beaa56f6 Mon Sep 17 00:00:00 2001 From: Simon Westphahl Date: Tue, 18 Jan 2022 12:09:50 +0100 Subject: [PATCH] Log duration of local tenant layout update Similar to the reconfiguration, log the time it takes for a scheduler to update the local layout of a tenant. Change-Id: I6e59684374bbdac282b8c7bf424498e242a9d295 --- zuul/scheduler.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/zuul/scheduler.py b/zuul/scheduler.py index 811943af15..7d492a8494 100644 --- a/zuul/scheduler.py +++ b/zuul/scheduler.py @@ -1075,6 +1075,7 @@ class Scheduler(threading.Thread): self.connections, self.zk_client, self.globals, self.statsd, self, self.merger, self.keystore) with self.layout_lock: + start = time.monotonic() log.debug("Updating local layout of tenant %s ", tenant_name) layout_state = self.tenant_layout_state.get(tenant_name) layout_uuid = layout_state and layout_state.uuid @@ -1097,6 +1098,10 @@ class Scheduler(threading.Thread): with suppress(KeyError): del self.local_layout_state[tenant_name] + duration = round(time.monotonic() - start, 3) + self.log.info("Local layout update complete for %s (duration: %s " + "seconds)", tenant_name, duration) + def _checkTenantSourceConf(self, config): tenant_config = None script = False