rbt parse
Change-Id: Icf7f51b8a486fef910272610d94a112046c3d525
This commit is contained in:
parent
9c188cc61a
commit
84c9bd95ee
@ -48,3 +48,17 @@ def parse_rpc(out):
|
||||
|
||||
def parse_traffic(out):
|
||||
return _parse_traffic(out, "Device")
|
||||
|
||||
def parse_rabbit(out):
|
||||
"""
|
||||
in:
|
||||
ts, {u'_unique_id': u'xxx', u'failure': None, u'ending': True, u'result': None, u'_msg_id': u'xxx'}
|
||||
out:
|
||||
name: RabbitMQ
|
||||
unit: None
|
||||
data: [(ts, <msg body>), ...]
|
||||
"""
|
||||
rbt_ret = {"name": "RabbitMQ",
|
||||
"unit": None,
|
||||
"data": out}
|
||||
return (rbt_ret, )
|
||||
|
@ -35,9 +35,10 @@ with Connection('amqp://guest:guest@localhost:5672//') as conn:
|
||||
queue = Queue("trace_", task_exchange, routing_key="publish.*", channel=chan)
|
||||
task_queues.append(queue)
|
||||
try:
|
||||
subprocess.check_call("sudo rabbitmqctl trace_on", shell=True)
|
||||
# Don't need check here, if commnd failed, it would raise CalledProcessError
|
||||
subprocess.check_output("sudo rabbitmqctl trace_on", shell=True)
|
||||
worker = Worker(conn)
|
||||
worker.run()
|
||||
except KeyboardInterrupt:
|
||||
subprocess.check_call("sudo rabbitmqctl trace_off", shell=True)
|
||||
subprocess.check_output("sudo rabbitmqctl trace_off", shell=True)
|
||||
queue.delete()
|
||||
|
Loading…
Reference in New Issue
Block a user