def setup_stomp(): global stomp logging.info("Getting Stomp Connection:") try: stomp = getNewStompConnection('', StatsListener()) except: logging.error("setup_stomp(): Cannot connect.") raise
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]')
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]")