From a60f55e37516d4b2c8b3845d64ed825a0307f1bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Fri, 18 May 2018 23:23:34 +0300 Subject: [PATCH] MXS-553: Display connections and their IDs in MaxCtrl The `show sessions` output now displays the servers each session is connected to along with their connections IDs. The output format of the data is not the most compact representation but it should make it relatively easy to parse. --- maxctrl/lib/show.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/maxctrl/lib/show.js b/maxctrl/lib/show.js index 5cb59a7d5..8b4a0079f 100644 --- a/maxctrl/lib/show.js +++ b/maxctrl/lib/show.js @@ -56,7 +56,9 @@ const session_fields = [ {'User': 'attributes.user'}, {'Host': 'attributes.remote'}, {'Connected': 'attributes.connected'}, - {'Idle': 'attributes.idle'} + {'Idle': 'attributes.idle'}, + {'Connections': 'attributes.connections[].server'}, + {'Connection IDs': 'attributes.connections[].protocol_diagnostics.connection_id'} ] const filter_fields = [ @@ -142,7 +144,10 @@ exports.builder = function(yargs) { return yargs.epilog('Show detailed information about a single session. ' + 'The list of sessions can be retrieved with the ' + '`list sessions` command. The is the session ' + - 'ID of a particular session.') + 'ID of a particular session.\n\n' + + 'The `Connections` field lists the servers to which ' + + 'the session is connected and the `Connection IDs` ' + + 'field lists the IDs for those connections.') .usage('Usage: show session ') }, function(argv) { maxctrl(argv, function(host) { @@ -150,7 +155,8 @@ exports.builder = function(yargs) { }) }) .command('sessions', 'Show all sessions', function(yargs) { - return yargs.epilog('Show detailed information about all sessions.') + return yargs.epilog('Show detailed information about all sessions. ' + + 'See `help show session` for more details.') .usage('Usage: show sessions') }, function(argv) { maxctrl(argv, function(host) {