mirror of
https://github.com/ceph/ceph
synced 2024-12-19 01:46:00 +00:00
crimson/osd: report statfs data
Signed-off-by: Xuehan Xu <xxhdx1985126@gmail.com>
This commit is contained in:
parent
471531e25d
commit
124aa74deb
@ -148,7 +148,6 @@ seastar::future<> Client::handle_mgr_conf(crimson::net::Connection* conn,
|
||||
|
||||
void Client::report()
|
||||
{
|
||||
with_stats.update_stats();
|
||||
gate.dispatch_in_background(__func__, *this, [this] {
|
||||
assert(conn);
|
||||
auto pg_stats = with_stats.get_stats();
|
||||
|
@ -24,7 +24,6 @@ namespace crimson::mgr
|
||||
// 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() {}
|
||||
};
|
||||
|
@ -89,7 +89,10 @@ OSD::OSD(int id, uint32_t nonce,
|
||||
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)))
|
||||
{
|
||||
@ -721,6 +724,11 @@ void OSD::update_stats()
|
||||
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
|
||||
|
@ -105,7 +105,7 @@ class OSD final : public crimson::net::Dispatcher,
|
||||
// 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
|
||||
|
Loading…
Reference in New Issue
Block a user