Add the build worker and job count information to the charts
This commit is contained in:
parent
63cd6ffcc3
commit
d359c849cd
9 changed files with 134 additions and 9 deletions
|
@ -5,7 +5,7 @@ from flask import request, Blueprint, abort, Response
|
|||
from flask.ext.login import current_user
|
||||
from auth.auth import require_session_login
|
||||
from endpoints.common import route_show_if
|
||||
from app import userevents
|
||||
from app import app, userevents
|
||||
from auth.permissions import SuperUserPermission
|
||||
|
||||
import features
|
||||
|
@ -26,6 +26,11 @@ def ps():
|
|||
|
||||
def generator():
|
||||
while True:
|
||||
builder_data = app.config['HTTPCLIENT'].get('http://localhost:8686/status', timeout=1)
|
||||
build_status = {}
|
||||
if builder_data.status_code == 200:
|
||||
build_status = json.loads(builder_data.text)
|
||||
|
||||
data = {
|
||||
'count': {
|
||||
'cpu': psutil.cpu_percent(interval=1, percpu=True),
|
||||
|
@ -34,7 +39,8 @@ def ps():
|
|||
'connections': len(psutil.net_connections()),
|
||||
'processes': len(psutil.pids()),
|
||||
'network': psutil.net_io_counters()
|
||||
}
|
||||
},
|
||||
'build': build_status
|
||||
}
|
||||
json_string = json.dumps(data)
|
||||
yield 'data: %s\n\n' % json_string
|
||||
|
|
Reference in a new issue