From db06582a067439a57e0d7f0da2193fc479736200 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 12 Feb 2015 14:16:53 -0800 Subject: [PATCH] osd/OSDMap: include pg_temp count in summary It is useful to know how big the pg_temp map is. Strictly speaking this is part of the OSDMap so I'm including it here. It looks like this: osdmap e25: 3 osds: 3 up, 3 in; 1 remapped pgs It might be more user-friendly to put it in a line with the pgmap somewhere (where other pg counts are included), but it doesn't quite fit there either. So sticking with where it lives in the data structure! Signed-off-by: Sage Weil --- src/osd/OSDMap.cc | 6 +++++- src/osd/OSDMap.h | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc index e93040c33c0b..174c81dca081 100644 --- a/src/osd/OSDMap.cc +++ b/src/osd/OSDMap.cc @@ -2575,12 +2575,16 @@ void OSDMap::print_summary(Formatter *f, ostream& out) const f->dump_int("num_in_osds", get_num_in_osds()); f->dump_bool("full", test_flag(CEPH_OSDMAP_FULL) ? true : false); f->dump_bool("nearfull", test_flag(CEPH_OSDMAP_NEARFULL) ? true : false); + f->dump_unsigned("num_remapped_pgs", get_num_pg_temp()); f->close_section(); } else { out << " osdmap e" << get_epoch() << ": " << get_num_osds() << " osds: " << get_num_up_osds() << " up, " - << get_num_in_osds() << " in\n"; + << get_num_in_osds() << " in"; + if (get_num_pg_temp()) + out << "; " << get_num_pg_temp() << " remapped pgs"; + out << "\n"; if (flags) out << " flags " << get_flag_string() << "\n"; } diff --git a/src/osd/OSDMap.h b/src/osd/OSDMap.h index a38533db8b0e..60e26102f48a 100644 --- a/src/osd/OSDMap.h +++ b/src/osd/OSDMap.h @@ -331,6 +331,9 @@ public: void get_up_osds(set& ls) const; unsigned get_num_up_osds() const; unsigned get_num_in_osds() const; + unsigned get_num_pg_temp() const { + return pg_temp->size(); + } int get_flags() const { return flags; } int test_flag(int f) const { return flags & f; } -- 2.47.3