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, ...@@ -223,8 +223,8 @@ def reworkui(engine,
def list_workers(): def list_workers():
# workers # workers
q = select( q = select(
'id', 'host', 'domain', 'pid', 'mem', 'shutdown', 'id', 'host', 'domain', 'pid', 'mem', 'cpu',
'kill', 'debugport', 'started' 'shutdown', 'kill', 'debugport', 'started'
).table('rework.worker' ).table('rework.worker'
).where('running = true' ).where('running = true'
).order('id') ).order('id')
...@@ -280,15 +280,17 @@ def reworkui(engine, ...@@ -280,15 +280,17 @@ def reworkui(engine,
r.th('pid@host') r.th('pid@host')
r.th('domain') r.th('domain')
r.th('memory (Mb)') r.th('memory (Mb)')
r.th('cpu')
r.th('debug port') r.th('debug port')
r.th('started') r.th('started')
r.th('action') 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: with t.tr() as r:
r.th(str(wid), scope='row') r.th(str(wid), scope='row')
r.td('{}@{}'.format(pid, host)) r.td('{}@{}'.format(pid, host))
r.td(domain) r.td(domain)
r.td(str(mem)) r.td(str(mem))
r.td(str(cpu))
r.td(debugport and str(debugport) or '') r.td(debugport and str(debugport) or '')
if started: if started:
started = started.astimezone(TZ).strftime('%Y-%m-%d %H:%M:%S%z') started = started.astimezone(TZ).strftime('%Y-%m-%d %H:%M:%S%z')
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
<th>pid@host</th> <th>pid@host</th>
<th>domain</th> <th>domain</th>
<th>memory (Mb)</th> <th>memory (Mb)</th>
<th>cpu</th>
<th>debug port</th> <th>debug port</th>
<th>started</th> <th>started</th>
<th>action</th> <th>action</th>
...@@ -31,6 +32,7 @@ ...@@ -31,6 +32,7 @@
<td><x>@<x>.<x>.<x>.<x></x></x></x></x></x></td> <td><x>@<x>.<x>.<x>.<x></x></x></x></x></x></td>
<td>default</td> <td>default</td>
<td><x></x></td> <td><x></x></td>
<td><x></x></td>
<td></td> <td></td>
<td><x>-<x>-<x> <x>:<x>:<x>+<x></x></x></x></x></x></x></x></td> <td><x>-<x>-<x> <x>:<x>:<x>+<x></x></x></x></x></x></x></x></td>
<td> <td>
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
<th>pid@host</th> <th>pid@host</th>
<th>domain</th> <th>domain</th>
<th>memory (Mb)</th> <th>memory (Mb)</th>
<th>cpu</th>
<th>debug port</th> <th>debug port</th>
<th>started</th> <th>started</th>
<th>action</th> <th>action</th>
...@@ -31,6 +32,7 @@ ...@@ -31,6 +32,7 @@
<td><x>@<x>.<x>.<x>.<x></x></x></x></x></x></td> <td><x>@<x>.<x>.<x>.<x></x></x></x></x></x></td>
<td>default</td> <td>default</td>
<td><x></x></td> <td><x></x></td>
<td><x></x></td>
<td></td> <td></td>
<td><x>-<x>-<x> <x>:<x>:<x>+<x></x></x></x></x></x></x></x></td> <td><x>-<x>-<x> <x>:<x>:<x>+<x></x></x></x></x></x></x></x></td>
<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