[MXS-3672] MaxCtrl output is not very readable Created: 2021-07-15  Updated: 2021-08-31  Resolved: 2021-08-31

Status: Closed
Project: MariaDB MaxScale
Component/s: maxctrl
Affects Version/s: 6
Fix Version/s: 6.2.0

Type: Bug Priority: Minor
Reporter: markus makela Assignee: markus makela
Resolution: Fixed Votes: 0
Labels: None


 Description   

The output of the various show commands contains fields that have pretty-printed JSON objects as their values. JSON itself is adequately readable for development purposes and small things but it is not an ideal format for displaying human-readable data. With the addition of new statistics to the REST API endpoints, the use of the pretty-printed JSON is starting to become unacceptable.

There are a number of ways to solve this. One way would be to introduce a show statistics command that displays the statistics of a particular object. This would give more screen space to neatly format the various fields. For example the output of show threads is currently this:

┌────────────────────────┬────┐
│ Id                     │ 0  │
├────────────────────────┼────┤
│ Accepts                │ 0  │
├────────────────────────┼────┤
│ Reads                  │ 44 │
├────────────────────────┼────┤
│ Writes                 │ 0  │
├────────────────────────┼────┤
│ Hangups                │ 0  │
├────────────────────────┼────┤
│ Errors                 │ 0  │
├────────────────────────┼────┤
│ Avg event queue length │ 1  │
├────────────────────────┼────┤
│ Max event queue length │ 1  │
├────────────────────────┼────┤
│ Max exec time          │ 0  │
├────────────────────────┼────┤
│ Max queue time         │ 0  │
├────────────────────────┼────┤
│ Current FDs            │ 3  │
├────────────────────────┼────┤
│ Total FDs              │ 3  │
├────────────────────────┼────┤
│ Load (1s)              │ 0  │
├────────────────────────┼────┤
│ Load (1m)              │ 0  │
├────────────────────────┼────┤
│ Load (1h)              │ 0  │
├────────────────────────┼────┤
│ QC cache size          │ 0  │
├────────────────────────┼────┤
│ QC cache inserts       │ 0  │
├────────────────────────┼────┤
│ QC cache hits          │ 0  │
├────────────────────────┼────┤
│ QC cache misses        │ 0  │
├────────────────────────┼────┤
│ QC cache evictions     │ 0  │
└────────────────────────┴────┘
┌────────────────────────┬────┐
│ Id                     │ 1  │
├────────────────────────┼────┤
│ Accepts                │ 0  │
├────────────────────────┼────┤
│ Reads                  │ 44 │
├────────────────────────┼────┤
│ Writes                 │ 0  │
├────────────────────────┼────┤
│ Hangups                │ 0  │
├────────────────────────┼────┤
│ Errors                 │ 0  │
├────────────────────────┼────┤
│ Avg event queue length │ 1  │
├────────────────────────┼────┤
│ Max event queue length │ 1  │
├────────────────────────┼────┤
│ Max exec time          │ 0  │
├────────────────────────┼────┤
│ Max queue time         │ 0  │
├────────────────────────┼────┤
│ Current FDs            │ 3  │
├────────────────────────┼────┤
│ Total FDs              │ 3  │
├────────────────────────┼────┤
│ Load (1s)              │ 0  │
├────────────────────────┼────┤
│ Load (1m)              │ 0  │
├────────────────────────┼────┤
│ Load (1h)              │ 0  │
├────────────────────────┼────┤
│ QC cache size          │ 0  │
├────────────────────────┼────┤
│ QC cache inserts       │ 0  │
├────────────────────────┼────┤
│ QC cache hits          │ 0  │
├────────────────────────┼────┤
│ QC cache misses        │ 0  │
├────────────────────────┼────┤
│ QC cache evictions     │ 0  │
└────────────────────────┴────┘
┌────────────────────────┬────┐
│ Id                     │ 2  │
├────────────────────────┼────┤
│ Accepts                │ 0  │
├────────────────────────┼────┤
│ Reads                  │ 44 │
├────────────────────────┼────┤
│ Writes                 │ 0  │
├────────────────────────┼────┤
│ Hangups                │ 0  │
├────────────────────────┼────┤
│ Errors                 │ 0  │
├────────────────────────┼────┤
│ Avg event queue length │ 1  │
├────────────────────────┼────┤
│ Max event queue length │ 1  │
├────────────────────────┼────┤
│ Max exec time          │ 0  │
├────────────────────────┼────┤
│ Max queue time         │ 0  │
├────────────────────────┼────┤
│ Current FDs            │ 3  │
├────────────────────────┼────┤
│ Total FDs              │ 3  │
├────────────────────────┼────┤
│ Load (1s)              │ 0  │
├────────────────────────┼────┤
│ Load (1m)              │ 0  │
├────────────────────────┼────┤
│ Load (1h)              │ 0  │
├────────────────────────┼────┤
│ QC cache size          │ 0  │
├────────────────────────┼────┤
│ QC cache inserts       │ 0  │
├────────────────────────┼────┤
│ QC cache hits          │ 0  │
├────────────────────────┼────┤
│ QC cache misses        │ 0  │
├────────────────────────┼────┤
│ QC cache evictions     │ 0  │
└────────────────────────┴────┘
┌────────────────────────┬────┐
│ Id                     │ 3  │
├────────────────────────┼────┤
│ Accepts                │ 0  │
├────────────────────────┼────┤
│ Reads                  │ 44 │
├────────────────────────┼────┤
│ Writes                 │ 0  │
├────────────────────────┼────┤
│ Hangups                │ 0  │
├────────────────────────┼────┤
│ Errors                 │ 0  │
├────────────────────────┼────┤
│ Avg event queue length │ 1  │
├────────────────────────┼────┤
│ Max event queue length │ 1  │
├────────────────────────┼────┤
│ Max exec time          │ 0  │
├────────────────────────┼────┤
│ Max queue time         │ 0  │
├────────────────────────┼────┤
│ Current FDs            │ 3  │
├────────────────────────┼────┤
│ Total FDs              │ 3  │
├────────────────────────┼────┤
│ Load (1s)              │ 0  │
├────────────────────────┼────┤
│ Load (1m)              │ 0  │
├────────────────────────┼────┤
│ Load (1h)              │ 0  │
├────────────────────────┼────┤
│ QC cache size          │ 0  │
├────────────────────────┼────┤
│ QC cache inserts       │ 0  │
├────────────────────────┼────┤
│ QC cache hits          │ 0  │
├────────────────────────┼────┤
│ QC cache misses        │ 0  │
├────────────────────────┼────┤
│ QC cache evictions     │ 0  │
└────────────────────────┴────┘

This would obviously be better represented in a proper table format with the descriptions as field headings and the data as rows. Here is an example of what it could look like:

┌────────────────────────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐
│ Id                     │ 0   │ 1   │ 2   │ 3   │ 4   │ 5   │ 6   │ 7   │
├────────────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ Accepts                │ 0   │ 0   │ 0   │ 0   │ 0   │ 0   │ 0   │ 0   │
├────────────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ Reads                  │ 304 │ 304 │ 304 │ 304 │ 304 │ 304 │ 304 │ 304 │
├────────────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ Writes                 │ 0   │ 0   │ 0   │ 0   │ 0   │ 0   │ 0   │ 0   │
├────────────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ Hangups                │ 0   │ 0   │ 0   │ 0   │ 0   │ 0   │ 0   │ 0   │
├────────────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ Errors                 │ 0   │ 0   │ 0   │ 0   │ 0   │ 0   │ 0   │ 0   │
├────────────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ Avg event queue length │ 1   │ 1   │ 1   │ 1   │ 1   │ 1   │ 1   │ 1   │
├────────────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ Max event queue length │ 1   │ 1   │ 1   │ 1   │ 1   │ 1   │ 1   │ 1   │
├────────────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ Max exec time          │ 0   │ 1   │ 1   │ 1   │ 1   │ 1   │ 1   │ 0   │
├────────────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ Max queue time         │ 0   │ 0   │ 0   │ 0   │ 0   │ 0   │ 0   │ 0   │
├────────────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ Current FDs            │ 6   │ 6   │ 6   │ 6   │ 6   │ 6   │ 6   │ 6   │
├────────────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ Total FDs              │ 6   │ 6   │ 6   │ 6   │ 6   │ 6   │ 6   │ 6   │
├────────────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ Load (1s)              │ 0   │ 0   │ 0   │ 0   │ 0   │ 0   │ 0   │ 0   │
├────────────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ Load (1m)              │ 0   │ 0   │ 0   │ 0   │ 0   │ 0   │ 0   │ 0   │
├────────────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ Load (1h)              │ 0   │ 0   │ 0   │ 0   │ 0   │ 0   │ 0   │ 0   │
├────────────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ QC cache size          │ 0   │ 0   │ 0   │ 0   │ 0   │ 0   │ 0   │ 0   │
├────────────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ QC cache inserts       │ 0   │ 0   │ 0   │ 0   │ 0   │ 0   │ 0   │ 0   │
├────────────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ QC cache hits          │ 0   │ 0   │ 0   │ 0   │ 0   │ 0   │ 0   │ 0   │
├────────────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ QC cache misses        │ 0   │ 0   │ 0   │ 0   │ 0   │ 0   │ 0   │ 0   │
├────────────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ QC cache evictions     │ 0   │ 0   │ 0   │ 0   │ 0   │ 0   │ 0   │ 0   │
└────────────────────────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘


Generated at Thu Feb 08 04:23:07 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.