]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/PGMap: add pg count for pools in the ceph df command 36945/head
authorVikhyat Umrao <vikhyat@redhat.com>
Wed, 26 Aug 2020 10:17:05 +0000 (03:17 -0700)
committerVikhyat Umrao <vikhyat@redhat.com>
Thu, 3 Sep 2020 05:42:19 +0000 (22:42 -0700)
Fixes: https://tracker.ceph.com/issues/46663
Signed-off-by: Vikhyat Umrao <vikhyat@redhat.com>
(cherry picked from commit 9ffbffbe6cd1d8dafb1dd88cbc1ce644afc7a915)

 Conflicts:
PendingReleaseNotes
        - Taking only release notes line for this commit

Signed-off-by: Vikhyat Umrao <vikhyat@redhat.com>
PendingReleaseNotes
src/mon/PGMap.cc

index 1c7ef204060b9520748a301f198f34f00dbd30a0..adae0004aefa6c36baa47f117636691c8a500d38 100644 (file)
@@ -1,3 +1,8 @@
+>=15.2.6
+--------
+
+* The ``ceph df`` command now lists the number of pgs in each pool.
+
 >=15.2.5
 --------
 
index 4d5950fc48a0851e0b6e9851b429d28e33f4a688..d7c8c397c35e084ab677dbaca685f70f6db3783b 100644 (file)
@@ -760,6 +760,7 @@ void PGMapDigest::dump_pool_stats_full(
   } else {
     tbl.define_column("POOL", TextTable::LEFT, TextTable::LEFT);
     tbl.define_column("ID", TextTable::LEFT, TextTable::RIGHT);
+    tbl.define_column("PGS", TextTable::LEFT, TextTable::RIGHT);
     tbl.define_column("STORED", TextTable::LEFT, TextTable::RIGHT);
     if (verbose) {
       tbl.define_column("(DATA)", TextTable::LEFT, TextTable::RIGHT);
@@ -791,6 +792,7 @@ void PGMapDigest::dump_pool_stats_full(
       continue;
 
     const string& pool_name = osd_map.get_pool_name(pool_id);
+    auto pool_pg_num = osd_map.get_pg_num(pool_id);
     const pool_stat_t &stat = pg_pool_sum.at(pool_id);
 
     const pg_pool_t *pool = osd_map.get_pg_pool(pool_id);
@@ -814,7 +816,8 @@ void PGMapDigest::dump_pool_stats_full(
       f->open_object_section("stats");
     } else {
       tbl << pool_name
-          << pool_id;
+          << pool_id
+          << pool_pg_num;
     }
     float raw_used_rate = osd_map.pool_raw_used_rate(pool_id);
     bool per_pool = use_per_pool_stats();