::encode(num_pg, bl);
::encode(num_pg_active, bl);
::encode(num_osd, bl);
- ::encode(osd_stat, bl);
+ unordered_map<int32_t,osd_stat_t> osd_stat_temp;
+ ::encode(osd_stat_temp, bl);
::encode(pg_pool_sum, bl, features);
::encode(osd_sum, bl);
::encode(pg_sum, bl, features);
::decode(num_pg, p);
::decode(num_pg_active, p);
::decode(num_osd, p);
- ::decode(osd_stat, p);
+ unordered_map<int32_t,osd_stat_t> osd_stat_temp;
+ ::decode(osd_stat_temp, p);
::decode(pg_pool_sum, p);
::decode(osd_sum, p);
::decode(pg_sum, p);
}
f->close_section();
f->open_array_section("osd_stats");
- for (auto& p : osd_stat) {
+ int i = 0;
+ // TODO: this isn't really correct since we can dump non-existent OSDs
+ // I dunno what osd_last_seq is set to in that case...
+ for (auto& p : osd_last_seq) {
f->open_object_section("osd_stat");
- f->dump_int("osd", p.first);
- f->dump_unsigned("seq", osd_last_seq[p.first]);
- p.second.dump(f);
+ f->dump_int("osd", i);
+ f->dump_unsigned("seq", p);
f->close_section();
+ ++i;
}
f->close_section();
f->open_array_section("num_pg_by_state");
virtual ~PGMapDigest() {}
mempool::pgmap::vector<uint64_t> osd_last_seq;
- mempool::pgmap::unordered_map<int32_t,osd_stat_t> osd_stat;
mutable std::map<int, int64_t> avail_space_by_rule;
void pool_cache_io_rate_summary(Formatter *f, ostream *out,
uint64_t poolid) const;
- void dump_pool_stats_full(const OSDMap &osd_map, stringstream *ss, Formatter *f,
- bool verbose) const;
+ virtual void dump_pool_stats_full(const OSDMap &osd_map, stringstream *ss,
+ Formatter *f, bool verbose) const;
void dump_fs_stats(stringstream *ss, Formatter *f, bool verbose) const;
static void dump_object_stat_sum(TextTable &tbl, Formatter *f,
const object_stat_sum_t &sum,
version_t version;
epoch_t last_osdmap_epoch; // last osdmap epoch i applied to the pgmap
epoch_t last_pg_scan; // osdmap epoch
+ mempool::pgmap::unordered_map<int32_t,osd_stat_t> osd_stat;
mempool::pgmap::unordered_map<pg_t,pg_stat_t> pg_stat;
mempool::pgmap::set<int32_t> full_osds; // for pre-luminous only
mempool::pgmap::set<int32_t> nearfull_osds; // for pre-luminous only
void dump_osd_stats(Formatter *f) const;
void dump_delta(Formatter *f) const;
void dump_filtered_pg_stats(Formatter *f, set<pg_t>& pgs) const;
+ void dump_pool_stats_full(const OSDMap &osd_map, stringstream *ss,
+ Formatter *f, bool verbose) const override {
+ get_rules_avail(osd_map, &avail_space_by_rule);
+ PGMapDigest::dump_pool_stats_full(osd_map, ss, f, verbose);
+ }
void dump_pg_stats_plain(
ostream& ss,