Qpid
  1. Qpid
  2. QPID-4139

qpid-stat -b does not show broker names anymore

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 0.14
    • Fix Version/s: 0.19
    • Component/s: Python Tools
    • Labels:

      Description

      qpid-stat -b does not show broker URL:

      1. qpid-stat -b
        Brokers
        broker cluster uptime conn sess exch queue
        =======================================================
        ? <standalone> 5s 1 1 8 5
        #

      It is a regression since qpid 0.7 where the URL was shown.

      A simple patch is to be proposed.

      1. qpid-stat_b-brokername.patch
        0.6 kB
        Pavel Moravec
      2. qpid-stat_add-cluster.patch
        1 kB
        Ernest Allen

        Activity

        Hide
        Pavel Moravec added a comment -

        Simple patch proposal.

        The root cause of the bug is that qmf/console.py package has method:

        def getUrl(self):
        """ """
        return BrokerURL(host=self.host, port=self.port)

        that returns an instance of BrokerURL class. This value is taken qpid-stat as:

        def displayBroker(self, subs):
        ..
        heads.append(Header('broker'))
        rows = []
        for broker in self.brokers:
        if self.cluster:
        ctext = "%s(%s)" % (self.cluster.clusterName, self.cluster.status)
        else:
        ctext = "<standalone>"
        row = (broker.getName(), ctext, broker.getUptime(),
        ..

        what is not properly formatted to output in qpid/disp.py where the if-statement in:

        def formatted(self, value):
        try:
        if value == None:
        return ''

        raises exception AttributeError - 'NoneType' object has no attribute 'scheme'.

        I am proposing a simple patch that converts the broker.getName() to string. It fixes the original problem though I don't know if it is not worth modifying "formatted(self, value)" method, rather.

        Show
        Pavel Moravec added a comment - Simple patch proposal. The root cause of the bug is that qmf/console.py package has method: def getUrl(self): """ """ return BrokerURL(host=self.host, port=self.port) that returns an instance of BrokerURL class. This value is taken qpid-stat as: def displayBroker(self, subs): .. heads.append(Header('broker')) rows = [] for broker in self.brokers: if self.cluster: ctext = "%s(%s)" % (self.cluster.clusterName, self.cluster.status) else: ctext = "<standalone>" row = (broker.getName(), ctext, broker.getUptime(), .. what is not properly formatted to output in qpid/disp.py where the if-statement in: def formatted(self, value): try: if value == None: return '' raises exception AttributeError - 'NoneType' object has no attribute 'scheme'. I am proposing a simple patch that converts the broker.getName() to string. It fixes the original problem though I don't know if it is not worth modifying "formatted(self, value)" method, rather.
        Hide
        Ernest Allen added a comment - - edited

        Adds cluster column to browser info table

        Patch proposal attached

        Here is the output for a clustered broker
        >[eallen@redhat ~]$ qpid-stat -g -b mrg26.lab.bos.redhat.com:5803
        >Broker Summary:
        > uptime cluster connections sessions exchanges queues
        > ==========================================================================
        > 53m 20s cluster_name<ACTIVE> 1 1 9 1

        If the broker is not clustered, the output looks like:
        >[eallen@redhat ~]$ qpid-stat -g -b grid0.lab.bos.redhat.com
        >Broker Summary:
        > uptime cluster connections sessions exchanges queues
        > ========================================================================
        > 47d 0h 38m 58s <standalone> 112 112 8 268

        Show
        Ernest Allen added a comment - - edited Adds cluster column to browser info table Patch proposal attached Here is the output for a clustered broker > [eallen@redhat ~] $ qpid-stat -g -b mrg26.lab.bos.redhat.com:5803 >Broker Summary: > uptime cluster connections sessions exchanges queues > ========================================================================== > 53m 20s cluster_name<ACTIVE> 1 1 9 1 If the broker is not clustered, the output looks like: > [eallen@redhat ~] $ qpid-stat -g -b grid0.lab.bos.redhat.com >Broker Summary: > uptime cluster connections sessions exchanges queues > ======================================================================== > 47d 0h 38m 58s <standalone> 112 112 8 268

          People

          • Assignee:
            Ted Ross
            Reporter:
            Pavel Moravec
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development