Add stats for executor and merger count
Report how many executors and mergers are online at any time. Also
report how many executors are accepting new jobs. Report the queues
associated with each.
This could be done in the executor or merger clients rather than
centrally in the scheduler, however, determining how many are online
requires a gear admin function, which is relatively expensive. To
reduce the cost, do it once for the whole system in the scheduler.
The scheduler doesn't directly have a gearman connection (though its
associated rpc listener, merge client, and executor clients do).
It didn't seem necessary to add another client for this, and the
rpc listener seemed the most appropriate connection to borrow (it's
purpose is to expose scheduler functions over gearman). The method
to count functions is added to it, and it in turn is now started
directly from the scheduler.
Change-Id: I09659c29431ebac7ecd1869cc4c1356026c03d26
diff --git a/tests/base.py b/tests/base.py
index a02ee5a..d3c5d62 100755
--- a/tests/base.py
+++ b/tests/base.py
@@ -58,7 +58,6 @@
import zuul.driver.github.githubconnection as githubconnection
import zuul.scheduler
import zuul.webapp
-import zuul.rpclistener
import zuul.executor.server
import zuul.executor.client
import zuul.lib.connections
@@ -2073,6 +2072,7 @@
gerritconnection.GerritEventConnector.delay = 0.0
self.sched = zuul.scheduler.Scheduler(self.config)
+ self.sched._stats_interval = 1
self.webapp = zuul.webapp.WebApp(
self.sched, port=0, listen_address='127.0.0.1')
@@ -2114,11 +2114,8 @@
self.sched.setNodepool(self.nodepool)
self.sched.setZooKeeper(self.zk)
- self.rpc = zuul.rpclistener.RPCListener(self.config, self.sched)
-
self.sched.start()
self.webapp.start()
- self.rpc.start()
self.executor_client.gearman.waitForServer()
# Cleanups are run in reverse order
self.addCleanup(self.assertCleanShutdown)
@@ -2374,8 +2371,6 @@
self.statsd.join()
self.webapp.stop()
self.webapp.join()
- self.rpc.stop()
- self.rpc.join()
self.gearman_server.shutdown()
self.fake_nodepool.stop()
self.zk.disconnect()