'maxctrl list sessions' will now show the connection
time and idleness in addition to the id, user, host
and service of the session. Further, the columns have
be reordered somewhat so that the id, user and host are
shown first, and the service last.
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.
The state of each individual listener is now displayed in the REST
API. Created common functions for printing the listener state and took
them into use. Added the new state into MaxCtrl output.
When the servers were iterated, each related monitor was requested. This
caused as many requests for monitors as there are servers.
By creating a set of unique monitor names and requesting them once, we
avoid the redundant requests from the monitor.
The function getResource had two different implementations that did very
different things. The newer version, that returns the raw JSON object that
represents a resource, was renamed to getJson.
Added the `GTID` field to make it easier to track GTID values of the
servers. This is done by requesting the related monitors for each server
and injecting an extra parameter into the server resource.
The yargs framework combined with the pkg packaging causes the executable
name to be mangled on installation. For this reason, the usage should be
explicitly added to each command.
Making the core a module proved to bring more problems than it solved. For
the sake of simplicity in installation and code coverage reporting, the
core is now completely contained in the `lib/` directory.
Also added preliminary coverage reporting with nyc.
Minor refactoring to the core library to allow multiple calls from within
the same program.
Added --quiet option to silence output so that tests aren't so
verbose. Currently this only works on UNIX based systems.
All invocations into the common helper functions are now done through the
`maxctrl` function. This allows the program arguments to be passed to the
core as a parameter instead of reading them from global variables.
This helps with the implicit initialization that was done when the yargs
library was required which caused duplicated output.
Refactored the core functions so that they only process the argument
vector. The parsing of the argument vector is done in maxctrl.js where it
is more appropriate.