can now sent teardown to slaves via script, and renamed to iqmgr.py
--HG-- rename : bin/iqstat.py => bin/iqmgr.py
This commit is contained in:
parent
3e21904583
commit
1fa69670c3
32
bin/iqmgr.py
Executable file
32
bin/iqmgr.py
Executable file
@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
import interp.bootstrap
|
||||
from interp.cluster import QueueManager, get_qs
|
||||
|
||||
m = QueueManager(address=('localhost', 6666), authkey='asdf')
|
||||
m.connect()
|
||||
|
||||
tq,rq,mq,sq = get_qs(m)
|
||||
|
||||
if len(sys.argv) == 1:
|
||||
sys.argv.append("st")
|
||||
|
||||
|
||||
if sys.argv[1].startswith("st"):
|
||||
print "interp queue status:"
|
||||
print " tasksq : %d" % tq.qsize()
|
||||
print " resultsq : %d" % rq.qsize()
|
||||
print " masterq : %d" % mq.qsize()
|
||||
print " slavesq : %d" % sq.qsize()
|
||||
|
||||
if sys.argv[1] == 'teardown':
|
||||
for i in xrange(mq.qsize()):
|
||||
print i, "killing", mq.get()
|
||||
sq.put("teardown")
|
||||
|
||||
if sys.argv[1] == 'clear':
|
||||
for i in xrange(tq.qsize()): print tq.get()
|
||||
for i in xrange(rq.qsize()): print rq.get()
|
||||
for i in xrange(mq.qsize()): print mq.get()
|
||||
for i in xrange(sq.qsize()): print sq.get()
|
Loading…
Reference in New Issue
Block a user