void update_osd_stat(vector<int>& hb_peers);
osd_stat_t get_osd_stat() {
Mutex::Locker l(stat_lock);
+ osd_stat.up_from = up_epoch;
+ ++osd_stat.seq;
return osd_stat;
}
// -- osd_stat_t --
void osd_stat_t::dump(Formatter *f) const
{
+ f->dump_unsigned("up_from", up_from);
+ f->dump_unsigned("seq", seq);
f->dump_unsigned("kb", kb);
f->dump_unsigned("kb_used", kb_used);
f->dump_unsigned("kb_avail", kb_avail);
void osd_stat_t::encode(bufferlist &bl) const
{
- ENCODE_START(5, 2, bl);
+ ENCODE_START(6, 2, bl);
::encode(kb, bl);
::encode(kb_used, bl);
::encode(kb_avail, bl);
::encode((uint32_t)0, bl);
::encode(op_queue_age_hist, bl);
::encode(os_perf_stat, bl);
+ ::encode(up_from, bl);
+ ::encode(seq, bl);
ENCODE_FINISH(bl);
}
void osd_stat_t::decode(bufferlist::iterator &bl)
{
- DECODE_START_LEGACY_COMPAT_LEN(5, 2, 2, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(6, 2, 2, bl);
::decode(kb, bl);
::decode(kb_used, bl);
::decode(kb_avail, bl);
::decode(op_queue_age_hist, bl);
if (struct_v >= 4)
::decode(os_perf_stat, bl);
+ if (struct_v >= 6) {
+ ::decode(up_from, bl);
+ ::decode(seq, bl);
+ }
DECODE_FINISH(bl);
}
objectstore_perf_stat_t os_perf_stat;
+ epoch_t up_from = 0;
+ uint64_t seq = 0;
+
osd_stat_t() : kb(0), kb_used(0), kb_avail(0),
snap_trim_queue_len(0), num_snap_trimming(0) {}