qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gmur...@apache.org
Subject [qpid-dispatch] branch master updated: DISPATCH-1228 - Made qdstat backward compatible with version 1.3 and 1.4
Date Wed, 19 Dec 2018 21:16:53 GMT
This is an automated email from the ASF dual-hosted git repository.

gmurthy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git


The following commit(s) were added to refs/heads/master by this push:
     new 65927db  DISPATCH-1228 - Made qdstat backward compatible with version 1.3 and 1.4
65927db is described below

commit 65927db66f37687ab6f37e3b5b6dd81178e04c3f
Author: Ganesh Murthy <gmurthy@redhat.com>
AuthorDate: Wed Dec 19 16:07:55 2018 -0500

    DISPATCH-1228 - Made qdstat backward compatible with version 1.3 and 1.4
---
 tools/qdstat.in | 48 ++++++++++++++++++++++++++++++++++--------------
 1 file changed, 34 insertions(+), 14 deletions(-)

diff --git a/tools/qdstat.in b/tools/qdstat.in
index 194baf0..7f767c2 100755
--- a/tools/qdstat.in
+++ b/tools/qdstat.in
@@ -343,11 +343,7 @@ class BusManager(Node):
         heads.append(Header("addr"))
         heads.append(Header("phs"))
         heads.append(Header("cap"))
-        heads.append(Header("pri"))
-        heads.append(Header("undel"))
-        heads.append(Header("unsett"))
-        heads.append(Header("del"))
-        heads.append(Header("presett"))
+
 
         rows = []
         cols = ('linkType', 'linkDir', 'connectionId', 'identity', 'peer', 'owningAddr',
@@ -358,12 +354,23 @@ class BusManager(Node):
         objects = self.query('org.apache.qpid.dispatch.router.link', cols, limit=self.opts.limit)
 
         has_dropped_presettled_count = False
+        has_priority = False
 
         if objects:
             first_row = objects[0]
             if first_row:
                 if hasattr(first_row, 'droppedPresettledCount'):
                     has_dropped_presettled_count = True
+                if hasattr(first_row, 'priority'):
+                    has_priority = True
+
+        if has_priority:
+            heads.append(Header("pri"))
+        heads.append(Header("undel"))
+        heads.append(Header("unsett"))
+        heads.append(Header("del"))
+        heads.append(Header("presett"))
+
 
         if has_dropped_presettled_count:
             heads.append(Header("psdrop"))
@@ -388,7 +395,8 @@ class BusManager(Node):
             row.append(self._addr_text(link.owningAddr))
             row.append(self._addr_phase(link.owningAddr))
             row.append(link.capacity)
-            row.append(link.priority)
+            if has_priority:
+                row.append(link.priority)
             row.append(link.undeliveredCount)
             row.append(link.unsettledCount)
             row.append(link.deliveryCount)
@@ -463,7 +471,24 @@ class BusManager(Node):
         heads.append(Header("addr"))
         heads.append(Header("phs"))
         heads.append(Header("distrib"))
-        heads.append(Header("pri"))
+
+        rows = []
+        cols = ('distribution', 'inProcess', 'subscriberCount', 'remoteCount',
+                'containerCount', 'deliveriesIngress', 'deliveriesEgress',
+                'deliveriesTransit', 'deliveriesToContainer', 'deliveriesFromContainer',
'name', 'priority')
+
+        objects = self.query('org.apache.qpid.dispatch.router.address', cols, limit=self.opts.limit)
+
+        has_priority = False
+
+        if objects:
+            first_row = objects[0]
+            if first_row:
+                if hasattr(first_row, 'priority'):
+                    has_priority = True
+
+        if has_priority:
+            heads.append(Header("pri"))
         heads.append(Header("in-proc", Header.COMMAS))
         heads.append(Header("local", Header.COMMAS))
         heads.append(Header("remote", Header.COMMAS))
@@ -473,12 +498,6 @@ class BusManager(Node):
         heads.append(Header("thru", Header.COMMAS))
         heads.append(Header("to-proc", Header.COMMAS))
         heads.append(Header("from-proc", Header.COMMAS))
-        rows = []
-        cols = ('distribution', 'inProcess', 'subscriberCount', 'remoteCount',
-                'containerCount', 'deliveriesIngress', 'deliveriesEgress',
-                'deliveriesTransit', 'deliveriesToContainer', 'deliveriesFromContainer',
'name', 'priority')
-
-        objects = self.query('org.apache.qpid.dispatch.router.address', cols, limit=self.opts.limit)
 
         for addr in objects:
             row = []
@@ -486,7 +505,8 @@ class BusManager(Node):
             row.append(self._addr_text(addr.name))
             row.append(self._addr_phase(addr.name))
             row.append(addr.distribution)
-            row.append(addr.priority if addr.priority >= 0 else "")
+            if has_priority:
+                row.append(addr.priority if addr.priority >= 0 else "")
             row.append(addr.inProcess)
             row.append(addr.subscriberCount)
             row.append(addr.remoteCount)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message