summaryrefslogtreecommitdiff
path: root/zuul
diff options
context:
space:
mode:
authorJames E. Blair <jim@acmegating.com>2023-02-14 16:32:51 -0800
committerJames E. Blair <jim@acmegating.com>2023-02-14 16:32:51 -0800
commit3a829196b9477da5a17a4a5ebf080662830431ad (patch)
tree0cd8b45580c16a24b6ab9dba6d681af2b4142573 /zuul
parent5922c66dd10fc2ba72683c173915be5df089cb2f (diff)
downloadzuul-3a829196b9477da5a17a4a5ebf080662830431ad.tar.gz
Expand the scope of zkprofile
Currently the zkprofile command only profiles the pipeline refresh operations. This expands the scope to include all pipeline operations (refreshing and then any subsequent changes). In particular, this will help identify places where we write too much data. Change-Id: Ida7bcb311b5037f6ce15a166ddeae6db44ed6709
Diffstat (limited to 'zuul')
-rw-r--r--zuul/scheduler.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/zuul/scheduler.py b/zuul/scheduler.py
index a546339c3..e81f1f900 100644
--- a/zuul/scheduler.py
+++ b/zuul/scheduler.py
@@ -2242,6 +2242,9 @@ class Scheduler(threading.Thread):
blocking=False) as lock,\
self.createZKContext(lock, self.log) as ctx:
with pipeline.manager.currentContext(ctx):
+ if ((tenant.name, pipeline.name) in
+ self._profile_pipelines):
+ ctx.profile = True
with self.statsd_timer(f'{stats_key}.handling'):
refreshed = self._process_pipeline(
tenant, pipeline)
@@ -2310,14 +2313,10 @@ class Scheduler(threading.Thread):
stats_key = f'zuul.tenant.{tenant.name}.pipeline.{pipeline.name}'
ctx = pipeline.manager.current_context
- if (tenant.name, pipeline.name) in self._profile_pipelines:
- ctx.profile = True
with self.statsd_timer(f'{stats_key}.refresh'):
pipeline.change_list.refresh(ctx)
pipeline.summary.refresh(ctx)
pipeline.state.refresh(ctx)
- if (tenant.name, pipeline.name) in self._profile_pipelines:
- ctx.profile = False
pipeline.state.setDirty(self.zk_client.client)
if pipeline.state.old_queues: