void Client::report()
{
- with_stats.update_stats();
gate.dispatch_in_background(__func__, *this, [this] {
assert(conn);
auto pg_stats = with_stats.get_stats();
// implement WithStats if you want to report stats to mgr periodically
class WithStats {
public:
- virtual void update_stats() = 0;
virtual MessageRef get_stats() const = 0;
virtual ~WithStats() {}
};
shard_services{*this, whoami, *cluster_msgr, *public_msgr, *monc, *mgrc, *store},
heartbeat{new Heartbeat{whoami, shard_services, *monc, hb_front_msgr, hb_back_msgr}},
// do this in background
- tick_timer{[this] { update_heartbeat_peers(); }},
+ tick_timer{[this] {
+ update_heartbeat_peers();
+ update_stats();
+ }},
asok{seastar::make_lw_shared<crimson::admin::AdminSocket>()},
osdmap_gate("OSD::osdmap_gate", std::make_optional(std::ref(shard_services)))
{
osd_stat.up_from = get_up_epoch();
osd_stat.hb_peers = heartbeat->get_peers();
osd_stat.seq = (static_cast<uint64_t>(get_up_epoch()) << 32) | osd_stat_seq;
+ gate.dispatch_in_background("statfs", *this, [this] {
+ (void) store->stat().then([this](store_statfs_t&& st) {
+ osd_stat.statfs = st;
+ });
+ });
}
MessageRef OSD::get_stats() const
// pg statistics including osd ones
osd_stat_t osd_stat;
uint32_t osd_stat_seq = 0;
- void update_stats() final;
+ void update_stats();
MessageRef get_stats() const final;
// AuthHandler methods