示例#1
0
def setup_stomp():
    global stomp
    logging.info("Getting Stomp Connection:")
    try:
        stomp = getNewStompConnection('', StatsListener())
    except:
        logging.error("setup_stomp(): Cannot connect.")
        raise
示例#2
0
 def do_stats(self, args):
     args = args.split()
     if len(args) < 1:
         stats = self.conn.get_listener('stats')
         if stats:
             self.__sysout(stats)
         else:
             self.__error('No stats available')
     elif args[0] == 'on':
         self.conn.set_listener('stats', StatsListener())
     elif args[0] == 'off':
         self.conn.remove_listener('stats')
     else:
         self.__error('Expecting: stats [on|off]')
示例#3
0
 def do_stats(self, args):
     args = args.split()
     if len(args) < 1:
         stats = self.conn.get_listener("stats")
         if stats:
             self.__sysout(stats)
         else:
             self.__error("No stats available")
     elif args[0] == "on":
         self.conn.set_listener("stats", StatsListener())
     elif args[0] == "off":
         self.conn.remove_listener("stats")
     else:
         self.__error("Expecting: stats [on|off]")