Project

General

Profile

Actions

Bug #19077

closed

Resize TextTable columns to the widest element of each column

Added by Keith Schincke about 7 years ago. Updated almost 7 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
4 - irritation
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

Running the command "rados df" on a cluster with long pool names or lots of data results in the stair stepping of the printed output. This results in data in a row not aligning with the column headings.

The requested change is to adjust the column widths prior to outputting the TextTable data.

Here is an example:

[root@overcloud-controller-0 ~]# rados mkpool areallyreallyverylonglongnameandthensome
successfully created pool areallyreallyverylonglongnameandthensome
[root@overcloud-controller-0 ~]# rados df
pool name KB objects clones degraded unfound rd rd KB wr wr KB
.rgw.root 6 20 0 37 0 831 609 38 31
areallyreallyverylonglongnameandthensome 0 0 0 0 0 0 0 0 0
backups 0 0 0 0 0 0 0 0 0
default.rgw.control 0 8 0 7 0 0 0 0 0
default.rgw.data.root 0 0 0 0 0 0 0 0 0
default.rgw.gc 0 32 0 42 0 576 544 384 0
default.rgw.log 0 127 0 153 0 6858 6731 4572 0
default.rgw.meta 1 1 0 2 0 0 0 2 1
default.rgw.users.keys 0 0 0 0 0 0 0 0 0
default.rgw.users.uid 1 1 0 2 0 0 0 2 1
images 0 0 0 0 0 0 0 0 0
metrics 1134 51 0 102 0 57 73 110 54
rbd 0 0 0 0 0 0 0 0 0
vms 0 0 0 0 0 0 0 0 0
volumes 0 0 0 0 0 0 0 0 0
total used 21138244 414
total avail 3295980156
total space 3317118400

Actions #1

Updated by Keith Schincke about 7 years ago

Updating the example for better formatting.
Here is an example:

[root@overcloud-controller-0 ~]# rados mkpool areallyreallyverylonglongnameandthensome
successfully created pool areallyreallyverylonglongnameandthensome
[root@overcloud-controller-0 ~]# rados df
pool name                 KB      objects       clones     degraded      unfound           rd        rd KB           wr        wr KB
.rgw.root                  6           20            0           37            0          831          609           38           31
areallyreallyverylonglongnameandthensome            0            0            0            0            0            0            0            0            0
backups                    0            0            0            0            0            0            0            0            0
default.rgw.control            0            8            0            7            0            0            0            0            0
default.rgw.data.root            0            0            0            0            0            0            0            0            0
default.rgw.gc             0           32            0           42            0          576          544          384            0
default.rgw.log            0          127            0          153            0         6858         6731         4572            0
default.rgw.meta            1            1            0            2            0            0            0            2            1
default.rgw.users.keys            0            0            0            0            0            0            0            0            0
default.rgw.users.uid            1            1            0            2            0            0            0            2            1
images                     0            0            0            0            0            0            0            0            0
metrics                 1134           51            0          102            0           57           73          110           54
rbd                        0            0            0            0            0            0            0            0            0
vms                        0            0            0            0            0            0            0            0            0
volumes                    0            0            0            0            0            0            0            0            0
  total used        21138244          414
  total avail     3295980156
  total space     3317118400

Actions #2

Updated by Sage Weil almost 7 years ago

  • Status changed from New to Resolved

This was recently reweritten to use TextTable, appeasr to be fine now:

POOL_NAME                                                   USED OBJECTS CLONES COPIES MISSING_ON_PRIMARY UNFOUND DEGRAED RD_OPS RD WR_OPS WR   
cephfs_data_a                                                  0       0      0      0                  0       0       0      0  0      0    0 
cephfs_metadata_a                                           2246      21      0     21                  0       0       0      0  0     42 8192 
rbd                                                            0       0      0      0                  0       0       0      0  0      0    0 
very-very-veyr-very-very-very-very-veyr-very-very-long-name    0       0      0      0                  0       0       0      0  0      0    0 

total_objects    21
total_used       238G
total_avail      133G
total_space      372G

probably post-jewel

Actions

Also available in: Atom PDF