o.push_back(new pg_create_t(1, pg_t(3, 4, -1), 2));
}
+
+// -- osd_peer_stat_t --
+
+void osd_peer_stat_t::encode(bufferlist& bl) const
+{
+ ENCODE_START(1, 1, bl);
+ ::encode(stamp, bl);
+ ENCODE_FINISH(bl);
+}
+
+void osd_peer_stat_t::decode(bufferlist::iterator& bl)
+{
+ DECODE_START(1, bl);
+ ::decode(stamp, bl);
+ DECODE_FINISH(bl);
+}
+
+void osd_peer_stat_t::dump(Formatter *f) const
+{
+ f->dump_stream("stamp") << stamp;
+}
+
+void osd_peer_stat_t::generate_test_instances(list<osd_peer_stat_t*>& o)
+{
+ o.push_back(new osd_peer_stat_t);
+ o.push_back(new osd_peer_stat_t);
+ o.back()->stamp = utime_t(1, 2);
+}
+
+ostream& operator<<(ostream& out, const osd_peer_stat_t &stat)
+{
+ return out << "stat(" << stat.stamp << ")";
+}
+
+
// -- OSDSuperblock --
void OSDSuperblock::encode(bufferlist &bl) const
// -----------------------------------------
struct osd_peer_stat_t {
- struct ceph_timespec stamp;
- float oprate;
- float qlen; // current
- float recent_qlen; // moving average
- float read_latency;
- float read_latency_mine;
- float frac_rd_ops_shed_in;
- float frac_rd_ops_shed_out;
-} __attribute__ ((packed));
-
-WRITE_RAW_ENCODER(osd_peer_stat_t)
-
-inline ostream& operator<<(ostream& out, const osd_peer_stat_t &stat) {
- return out << "stat(" << stat.stamp
- << " oprate=" << stat.oprate
- << " qlen=" << stat.qlen
- << " recent_qlen=" << stat.recent_qlen
- << " rdlat=" << stat.read_latency_mine << " / " << stat.read_latency
- << " fshedin=" << stat.frac_rd_ops_shed_in
- << ")";
-}
+ utime_t stamp;
+ osd_peer_stat_t() { }
+
+ void encode(bufferlist &bl) const;
+ void decode(bufferlist::iterator &bl);
+ void dump(Formatter *f) const;
+ static void generate_test_instances(list<osd_peer_stat_t*>& o);
+};
+WRITE_CLASS_ENCODER(osd_peer_stat_t)
+ostream& operator<<(ostream& out, const osd_peer_stat_t &stat);
// -----------------------------------------