template<typename Callback, typename...Args>
void with_osdmap(Callback&& cb, Args&&...args)
{
- Mutex::Locker l(lock);
assert(objecter != nullptr);
objecter->with_osdmap(cb);
}
PyFormatter f;
cluster_state.with_pgmap(
[&f](const PGMap &pg_map) {
- // f.open_object_section("outer");
std::map<std::string, std::map<std::string, uint32_t> > osds;
std::map<std::string, std::map<std::string, uint32_t> > pools;
std::map<std::string, uint32_t> all;
f.dump_int(i.first.c_str(), i.second);
}
f.close_section();
- // f.close_section();
}
);
return f.get();
+ } else if (what == "df") {
+ PyFormatter f;
+
+ cluster_state.with_osdmap([this, &f](const OSDMap &osd_map){
+ cluster_state.with_pgmap(
+ [osd_map, &f](const PGMap &pg_map) {
+ pg_map.dump_fs_stats(nullptr, &f, true);
+ pg_map.dump_pool_stats(osd_map, nullptr, &f, true);
+ });
+ });
+ return f.get();
} else if (what == "health" || what == "mon_status") {
PyFormatter f;
bufferlist json;