From 515cc3231c25b6398f2063f27d3ce6c12de7bc67 Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Wed, 8 Aug 2018 10:04:14 +0300 Subject: [PATCH] MXS-2000 Introduce 'maxctrl list threads' Basically the same as the existing 'show threads', with a bit shorter names. The current 'show threads' will be changed to resemble the other 'show' commands, that is, the output is a list of detailed information of each object. --- maxctrl/lib/list.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/maxctrl/lib/list.js b/maxctrl/lib/list.js index 3611f3053..ed234150f 100644 --- a/maxctrl/lib/list.js +++ b/maxctrl/lib/list.js @@ -158,6 +158,21 @@ exports.builder = function(yargs) { ]) }) }) + .command('threads', 'List threads', function(yargs) { + return yargs.epilog('List all worker threads.') + .usage('Usage: list threads') + }, function(argv) { + maxctrl(argv, function(host) { + return getCollection(host, 'maxscale/threads', [ + {'Id': 'id'}, + {'Current FDs': 'attributes.stats.current_descriptors'}, + {'Total FDs': 'attributes.stats.total_descriptors'}, + {'Load (1s)': 'attributes.stats.load.last_second'}, + {'Load (1m)': 'attributes.stats.load.last_minute'}, + {'Load (1h)': 'attributes.stats.load.last_hour'} + ]) + }) + }) .command('users', 'List created network users', function(yargs) { return yargs.epilog('List the users that can be used to connect to the MaxScale REST API.') .usage('Usage: list users')