Commit 0c0e583a authored by Aurélien Campéas's avatar Aurélien Campéas
Browse files

show the cpu usage

parent c641c86f7387
......@@ -223,8 +223,8 @@ def reworkui(engine,
def list_workers():
# workers
q = select(
'id', 'host', 'domain', 'pid', 'mem', 'shutdown',
'kill', 'debugport', 'started'
'id', 'host', 'domain', 'pid', 'mem', 'cpu',
'shutdown', 'kill', 'debugport', 'started'
).table('rework.worker'
).where('running = true'
).order('id')
......@@ -280,15 +280,17 @@ def reworkui(engine,
r.th('pid@host')
r.th('domain')
r.th('memory (Mb)')
r.th('cpu')
r.th('debug port')
r.th('started')
r.th('action')
for wid, host, domain, pid, mem, shutdown, kill, debugport, started in workers:
for wid, host, domain, pid, mem, cpu, shutdown, kill, debugport, started in workers:
with t.tr() as r:
r.th(str(wid), scope='row')
r.td('{}@{}'.format(pid, host))
r.td(domain)
r.td(str(mem))
r.td(str(cpu))
r.td(debugport and str(debugport) or '')
if started:
started = started.astimezone(TZ).strftime('%Y-%m-%d %H:%M:%S%z')
......
......@@ -22,6 +22,7 @@
<th>pid@host</th>
<th>domain</th>
<th>memory (Mb)</th>
<th>cpu</th>
<th>debug port</th>
<th>started</th>
<th>action</th>
......@@ -31,6 +32,7 @@
<td><x>@<x>.<x>.<x>.<x></x></x></x></x></x></td>
<td>default</td>
<td><x></x></td>
<td><x></x></td>
<td></td>
<td><x>-<x>-<x> <x>:<x>:<x>+<x></x></x></x></x></x></x></x></td>
<td>
......
......@@ -22,6 +22,7 @@
<th>pid@host</th>
<th>domain</th>
<th>memory (Mb)</th>
<th>cpu</th>
<th>debug port</th>
<th>started</th>
<th>action</th>
......@@ -31,6 +32,7 @@
<td><x>@<x>.<x>.<x>.<x></x></x></x></x></x></td>
<td>default</td>
<td><x></x></td>
<td><x></x></td>
<td></td>
<td><x>-<x>-<x> <x>:<x>:<x>+<x></x></x></x></x></x></x></x></td>
<td>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment