sozu icon indicating copy to clipboard operation
sozu copied to clipboard

How to format tables in the CLI (and other things)

Open Keksoj opened this issue 3 years ago • 0 comments

Here is an example of metrics formatting:

Worker 0
=========
+--------------------+-------+-------+
|                    | gauge | count |
+--------------------+-------+-------+
| accept_queue.count | 0     |       |
+--------------------+-------+-------+
| client.connections | 0     |       |
+--------------------+-------+-------+
| slab.count         | 6     |       |
+--------------------+-------+-------+


+-----------------+---------+------+------+------+-------+--------+---------+------+
| Percentiles     | samples | p50  | p90  | p99  | p99.9 | p99.99 | p99.999 | p100 |
+-----------------+---------+------+------+------+-------+--------+---------+------+
| epoll_time      | 1681    | 1001 | 1001 | 1001 | 1003  | 1006   | 1006    | 1006 |
+-----------------+---------+------+------+------+-------+--------+---------+------+
| event_loop_time | 1681    | 0    | 0    | 0    | 99    | 124    | 124     | 124  |
+-----------------+---------+------+------+------+-------+--------+---------+------+

We can choose the table formatting from these variants of the prettytable crate.

What do you people prefer? @BlackYoup @Geal @FlorentinDUBOIS

Keksoj avatar Aug 17 '22 15:08 Keksoj