]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
show the total pg on each osd.
authorsongbaisen <song.baisen@zte.com.cn>
Fri, 15 Jan 2016 10:01:18 +0000 (18:01 +0800)
committerBoris Ranto <branto@redhat.com>
Fri, 6 May 2016 11:44:18 +0000 (13:44 +0200)
ceph pg dump osds
dumped osds in format plain
osdstat kbused kbavail kb hb in hb out pg sum
143304204 79623420 234882056 [1,2] [] 330
143304204 79623420 234882056 [0,2] [] 295
143304148 79623476 234882056 [0,1] [] 303
sum 429912556 238870316 704646168

Fixes:#14183
Signed-off-by: songbaisen song.baisen@zte.com.cn
src/mon/PGMap.cc

index fbef9bab0c4b5980e29cd554f6b3e3010fa7a4e6..645514bda247d47ce87d4d7ba65ce5abd1a01908 100644 (file)
@@ -885,7 +885,7 @@ void PGMap::dump_pg_sum_stats(ostream& ss, bool header) const
 
 void PGMap::dump_osd_stats(ostream& ss) const
 {
-  ss << "osdstat\tkbused\tkbavail\tkb\thb in\thb out" << std::endl;
+  ss << "osdstat\tkbused\tkbavail\tkb\thb in\thb out\tpg sum" << std::endl;
   for (ceph::unordered_map<int32_t,osd_stat_t>::const_iterator p = osd_stat.begin();
        p != osd_stat.end();
        ++p) {
@@ -895,6 +895,7 @@ void PGMap::dump_osd_stats(ostream& ss) const
        << "\t" << p->second.kb
        << "\t" << p->second.hb_in
        << "\t" << p->second.hb_out
+       << "\t" << get_num_pg_by_osd(p->first)
        << std::endl;
   }
   ss << " sum\t" << osd_sum.kb_used