diff options
| author | Marko Kreen | 2011-07-04 12:05:35 +0000 |
|---|---|---|
| committer | Marko Kreen | 2011-07-04 12:48:34 +0000 |
| commit | 856fa31833d666e3ab6bc211bf71554caad8ac59 (patch) | |
| tree | 226475568e7894106cd177ef55af7713b14f514f /python/pgq/cascade | |
| parent | bf3ee2c79f9251c1cd9e6eb31288b1079c2f4015 (diff) | |
CascadeAdmin: node-info command
Shows detailed info about local node.
Currently the info needs to be gathered from different places,
which is annoying.
Diffstat (limited to 'python/pgq/cascade')
| -rw-r--r-- | python/pgq/cascade/admin.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/python/pgq/cascade/admin.py b/python/pgq/cascade/admin.py index e3fb2096..75fea6d6 100644 --- a/python/pgq/cascade/admin.py +++ b/python/pgq/cascade/admin.py @@ -694,6 +694,37 @@ class CascadeAdmin(skytools.AdminScript): " from pgq_node.get_queue_locations(%s) order by 1" self.display_table(db, desc, q, [self.queue_name]) + def cmd_node_info(self): + self.load_local_info() + + q = self.queue_info + n = q.local_node + m = q.get_member(n.name) + + stlist = [] + if m.dead: + stlist.append('DEAD') + if n.paused: + stlist.append("PAUSED") + if not n.uptodate: + stlist.append("NON-UP-TO-DATE") + st = ', '.join(stlist) + if not st: + st = 'OK' + print('Node: %s Type: %s Queue: %s' % (n.name, n.type, q.queue_name)) + print('Status: %s' % st) + if n.type != 'root': + print('Provider: %s' % n.provider_node) + else: + print('Provider: --') + print('Connect strings:') + print(' Local : %s' % self.cf.get('db')) + print(' Public : %s' % m.location) + if n.type != 'root': + print(' Provider: %s' % n.provider_location) + if n.combined_queue: + print('Combined Queue: %s (node type: %s)' % (n.combined_queue, n.combined_type)) + # # Shortcuts for operating on nodes. # |
