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.
This commit is contained in:
Markus Mäkelä 2018-05-18 23:23:34 +03:00
parent 3f4d6391b5
commit a60f55e375
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -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 <session> 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 <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) {