Commit b2feaa96 authored by Taddeüs Kroes's avatar Taddeüs Kroes

Cleanup

parent 1acdcc82
...@@ -26,7 +26,7 @@ connect = -> ...@@ -26,7 +26,7 @@ connect = ->
console.log 'msg', msg.data console.log 'msg', msg.data
data = JSON.parse(msg.data) data = JSON.parse(msg.data)
set('release', data.os) if data.os set('release', data.release) if data.release
set('uptime', fmt_time(data.uptime)) if data.uptime set('uptime', fmt_time(data.uptime)) if data.uptime
......
...@@ -43,7 +43,7 @@ def stats(): ...@@ -43,7 +43,7 @@ def stats():
# Memory usage # Memory usage
with open('/proc/meminfo', 'r') as f: with open('/proc/meminfo', 'r') as f:
for line in f.readlines(): for line in f:
if line.startswith('MemTotal'): if line.startswith('MemTotal'):
assert line.endswith('kB\n') assert line.endswith('kB\n')
total = int(line.split()[1]) total = int(line.split()[1])
...@@ -62,6 +62,7 @@ def stats(): ...@@ -62,6 +62,7 @@ def stats():
yield 'disk', (used, used + avail) yield 'disk', (used, used + avail)
break break
if __name__ == '__main__': if __name__ == '__main__':
server = websocket(extensions=[WebkitDeflateFrame()]) server = websocket(extensions=[WebkitDeflateFrame()])
server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
...@@ -83,7 +84,6 @@ if __name__ == '__main__': ...@@ -83,7 +84,6 @@ if __name__ == '__main__':
while True: while True:
if not clients: if not clients:
time.sleep(6) time.sleep(6)
#time.sleep(.1)
continue continue
status = Frame(OPCODE_TEXT, json.dumps(dict(stats()))) status = Frame(OPCODE_TEXT, json.dumps(dict(stats())))
......
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