mirror of
https://github.com/ceph/ceph
synced 2025-03-11 02:39:05 +00:00
include/frag: add a dump() method to fragtree_t
Signed-off-by: John Spray <john.spray@redhat.com>
This commit is contained in:
parent
62ee84eb36
commit
842a4c32d3
@ -498,6 +498,21 @@ public:
|
||||
}
|
||||
out << ")";
|
||||
}
|
||||
|
||||
void dump(Formatter *f) const {
|
||||
f->open_array_section("splits");
|
||||
for (compact_map<frag_t,int32_t>::const_iterator p = _splits.begin();
|
||||
p != _splits.end();
|
||||
++p) {
|
||||
f->open_object_section("split");
|
||||
std::ostringstream frag_str;
|
||||
frag_str << p->first;
|
||||
f->dump_string("frag", frag_str.str());
|
||||
f->dump_int("children", p->second);
|
||||
f->close_section(); // split
|
||||
}
|
||||
f->close_section(); // splits
|
||||
}
|
||||
};
|
||||
WRITE_CLASS_ENCODER(fragtree_t)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user