command line test puller
This commit is contained in:
parent
4a7e34ed8a
commit
4a4eb6008d
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
import socket
|
||||
import json
|
||||
import time
|
||||
|
||||
while True:
|
||||
try:
|
||||
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
sock.connect(('', 6000))
|
||||
data = sock.recv(10000)
|
||||
sock.close()
|
||||
#print data
|
||||
stats = json.loads(data)
|
||||
for stat in stats["Stats"]:
|
||||
print "%s: %f" % (stat["type"] ,stat["value"])
|
||||
print "----"
|
||||
time.sleep(1)
|
||||
except KeyboardInterrupt:
|
||||
print "\nExiting..."
|
||||
break
|
||||
except:
|
||||
print "\nError..."
|
||||
break
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue