Emit some stats from executor
Emit the load average, a counter for builds, and a guage for
running builds.
Change-Id: I8541724f1322b8257b623b3b2cfd8f3e6b95574d
diff --git a/tests/base.py b/tests/base.py
index 028a194..035ff0c 100755
--- a/tests/base.py
+++ b/tests/base.py
@@ -1429,6 +1429,9 @@
be explicitly released.
"""
+
+ _job_class = RecordingAnsibleJob
+
def __init__(self, *args, **kw):
self._run_ansible = kw.pop('_run_ansible', False)
self._test_root = kw.pop('_test_root', False)
@@ -1483,8 +1486,7 @@
args = json.loads(job.arguments)
args['zuul']['_test'] = dict(test_root=self._test_root)
job.arguments = json.dumps(args)
- self.job_workers[job.unique] = RecordingAnsibleJob(self, job)
- self.job_workers[job.unique].run()
+ super(RecordingExecutorServer, self).executeJob(job)
def stopJob(self, job):
self.log.debug("handle stop")
diff --git a/tests/unit/test_scheduler.py b/tests/unit/test_scheduler.py
index c1f0a0e..ab0d0fd 100755
--- a/tests/unit/test_scheduler.py
+++ b/tests/unit/test_scheduler.py
@@ -117,6 +117,8 @@
self.assertReportedStat(
'zuul.tenant.tenant-one.pipeline.gate.project.review_example_com.'
'org_project.master.total_changes', value='1|c')
+ exec_key = 'zuul.executor.%s' % self.executor_server.hostname
+ self.assertReportedStat(exec_key + '.builds', value='1|c')
for build in self.history:
self.assertTrue(build.parameters['zuul']['voting'])