Enhance logging of status_get requests

We don't have any logging of status_get requests that are handled
within the scheduler. This can be a bottleneck in larger zuul
deployments so add logging of them and timing and payload sizes so we
can judge on further optimization efforts.

Change-Id: I50971b89959b26e60b754198f5f6de96e7ffacbd
This commit is contained in:
Tobias Henkel 2021-01-20 17:53:55 +01:00
parent 944b455ff2
commit 4536b452ee
No known key found for this signature in database
GPG Key ID: 03750DEC158E5FA2
1 changed files with 5 additions and 0 deletions

View File

@ -388,7 +388,12 @@ class RPCListener(RPCListenerBase):
def handle_status_get(self, job):
args = json.loads(job.arguments)
start = time.monotonic()
output = self.sched.formatStatusJSON(args.get("tenant"))
end = time.monotonic()
self.log.debug('Formatting tenant %s status took %.3f seconds for '
'%d bytes', args.get("tenant"), end - start,
len(output))
job.sendWorkComplete(output)
def handle_job_get(self, gear_job):