Add the build worker and job count information to the charts

This commit is contained in:
Joseph Schorr 2015-01-28 17:12:33 -05:00
parent 63cd6ffcc3
commit d359c849cd
9 changed files with 134 additions and 9 deletions

View file

@ -1,5 +1,6 @@
import logging
import trollius
import json
from autobahn.asyncio.wamp import RouterFactory, RouterSessionFactory
from autobahn.asyncio.websocket import WampWebSocketServerFactory
@ -63,7 +64,20 @@ class BuilderServer(object):
@controller_app.route('/status')
def status():
return server._current_status
(running_count, available_count) = server._queue.get_metrics()
workers = [component for component in server._current_components
if component.kind() == 'builder']
data = {
'status': server._current_status,
'running_local': server._job_count,
'running_total': running_count,
'workers': len(workers),
'job_total': available_count
}
return json.dumps(data)
self._controller_app = controller_app