MXS-1782: Add show threads to MaxCtrl

Provides same output in MaxCtrl that is in MaxAdmin.
This commit is contained in:
Markus Mäkelä 2018-04-15 08:58:52 +03:00
parent c90cfc0bee
commit f8a91fb272
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19
2 changed files with 19 additions and 0 deletions

View File

@ -148,6 +148,7 @@ Commands:
filter <filter> Show filter
module <module> Show loaded module
maxscale Show MaxScale information
threads Show worker thread information
logging Show MaxScale logging information
commands <module> Show module commands of a module
@ -204,6 +205,10 @@ information of a loaded module.
See `help alter maxscale` for more details about altering MaxScale parameters.
### show threads
`Usage: show threads`
### show logging
`Usage: show logging`

View File

@ -146,6 +146,20 @@ exports.builder = function(yargs) {
])
})
})
.command('threads', 'Show worker thread information', function(yargs) {
return yargs.usage('Usage: show threads')
}, function(argv) {
maxctrl(argv, function(host) {
return getCollection(host, 'maxscale/threads', [
{'ID': 'id'},
{'Current File Descriptors': 'attributes.stats.current_descriptors'},
{'Total File Descriptors': 'attributes.stats.total_descriptors'},
{'Load Percentage (1s)': 'attributes.stats.load.last_second'},
{'Load Percentage (1m)': 'attributes.stats.load.last_minute'},
{'Load Percentage (1h)': 'attributes.stats.load.last_hour'}
])
})
})
.command('logging', 'Show MaxScale logging information', function(yargs) {
return yargs.epilog('See `help alter logging` for more details about altering ' +
'logging parameters.')