added watch-like functionality to iqmgr.py, but it seems to break the server
This commit is contained in:
parent
ca49c7eec7
commit
9d85053b0e
21
bin/iqmgr.py
21
bin/iqmgr.py
@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
import time
|
||||||
import interp.bootstrap
|
import interp.bootstrap
|
||||||
from interp.cluster import QueueManager, get_qs
|
from interp.cluster import QueueManager, get_qs
|
||||||
|
|
||||||
@ -20,6 +21,24 @@ if sys.argv[1].startswith("st"):
|
|||||||
print " masterq : %d" % mq.qsize()
|
print " masterq : %d" % mq.qsize()
|
||||||
print " minionsq : %d" % sq.qsize()
|
print " minionsq : %d" % sq.qsize()
|
||||||
|
|
||||||
|
if sys.argv[1].startswith("wa"):
|
||||||
|
if len(sys.argv) == 3:
|
||||||
|
sleeptime = float(sys.argv[2])
|
||||||
|
else:
|
||||||
|
sleeptime = 1
|
||||||
|
|
||||||
|
i = 0
|
||||||
|
while True:
|
||||||
|
time.sleep(sleeptime)
|
||||||
|
if i % 20 == 0:
|
||||||
|
print "tasksq resultsq masterq minionsq"
|
||||||
|
print "%d %d %d %d" % \
|
||||||
|
(tq.qsize(),
|
||||||
|
rq.qsize(),
|
||||||
|
mq.qsize(),
|
||||||
|
sq.qsize(),)
|
||||||
|
i += 1
|
||||||
|
|
||||||
if sys.argv[1] == 'add':
|
if sys.argv[1] == 'add':
|
||||||
for i in xrange(int(sys.argv[2])):
|
for i in xrange(int(sys.argv[2])):
|
||||||
mq.put('jane')
|
mq.put('jane')
|
||||||
@ -31,7 +50,7 @@ if sys.argv[1] == 'slay':
|
|||||||
sq.put("slay")
|
sq.put("slay")
|
||||||
elif len(sys.argv) == 3:
|
elif len(sys.argv) == 3:
|
||||||
for i in xrange(int(sys.argv[2])):
|
for i in xrange(int(sys.argv[2])):
|
||||||
print i, "killing ... jane?"
|
print i, "killing", mq.get()
|
||||||
sq.put("slay")
|
sq.put("slay")
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user