Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools: use TextTable for "rados df" plain output #9362

Merged
merged 4 commits into from Jul 26, 2016

Conversation

xiexingguo
Copy link
Member

@xiexingguo xiexingguo commented May 27, 2016

E.g.:

[root@c7 x86_64]# rados df
POOL_NAME                     USED  OBJECTS CLONES COPIES MISSING_ON_PRIMARY UNFOUND DEGRAED RD     RD_OPS  WR     WR_OPS  
.rgw.root                     13514 23      0      46     0                  0       0       54575k 72692   95232  133     
p1                            535G  621     0      1863   0                  0       1128    6525k  6561    643M   145331  
p2                            318   8       0      16     0                  0       0       2418k  2446    6144   660     
us-east.rgw.buckets.data      1993M 4706    0      9412   0                  0       0       1924M  146254  5865M  218791  
us-east.rgw.buckets.index     0     665     0      1330   0                  0       0       418M   261239  0      114593  
us-east.rgw.buckets.non-ec    0     1       0      2      0                  0       0       18432  16      0      97      
us-east.rgw.control           0     8       0      16     0                  0       0       0      0       0      0       
us-east.rgw.data.root         91992 292     0      584    0                  0       37      21620k 27003   462k   1511    
us-east.rgw.gc                0     32      0      64     0                  0       0       265M   268427  0      217712  
us-east.rgw.log               3201k 1090    0      2180   0                  0       0       5679M  5953080 11509k 3789703 
us-east.rgw.meta              628k  1958    0      3916   0                  0       0       0      0       2011k  4343    
us-east.rgw.usage             0     13      0      26     0                  0       0       5402k  2814    0      892     
us-east.rgw.users.email       144   14      0      28     0                  0       0       0      0       30720  46      
us-east.rgw.users.keys        330   33      0      66     0                  0       6       158k   243     1289k  2545    
us-east.rgw.users.swift       36    3       0      6      0                  0       0       0      0       3072   3       
us-east.rgw.users.uid         10686 45      0      90     0                  0       0       30743k 30776   1496k  9822    
us-east.ssd.rgw.buckets.data  171k  4       0      8      0                  0       0       0      0       173k   38      
us-east.ssd.rgw.buckets.index 0     19      0      38     0                  0       1       864k   864     0      71      

==============================================================
Total Cluster Usage
==============================================================
total_objects    9535
total_used       35530M
total_avail      158G
total_space      192G
==============================================================

cout << "total_space " << si_t(tstats.kb << 10)
<< std::endl;
cout << "=============================================================="
<< std::endl;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this last section, can we drop tne ==== lines (a blank line is sufficient), and the _'s?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Thanks for the review.

@liewegas
Copy link
Member

👍 thanks!

<< prettybyte_t(p->second.kb_used)
<< prettybyte_t(p->second.kb_avail)
<< prettybyte_t(p->second.kb)
<< prettybyte_t(p->second.kb_used << 10)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'd recommend s/prettybyte_t/kb_t/ here.

tab.define_column("MISSING_ON_PRIMARY", TextTable::LEFT, TextTable::LEFT);
tab.define_column("DEGRADED", TextTable::LEFT, TextTable::LEFT);
tab.define_column("MISPLACED", TextTable::LEFT, TextTable::LEFT);
tab.define_column("UNFOUND", TextTable::LEFT, TextTable::LEFT);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the numeric values should all be right justified

@xiexingguo
Copy link
Member Author

Dropped that change.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
The prettybyte_t considers the input as bytes, so the
pre-cast is needed here.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
which is simpler and better for alignment.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
So the whole output looks gorgeous.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
@xiexingguo xiexingguo deleted the xxg-wip-texttable-df branch July 26, 2016 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants