return false;
}
+void MgrClient::send_stats()
+{
+ send_report();
+ send_pgstats();
+ if (stats_period != 0) {
+ report_callback = new FunctionContext([this](int){send_stats();});
+ timer.add_event_after(stats_period, report_callback);
+ }
+}
+
void MgrClient::send_report()
{
assert(lock.is_locked_by_me());
report->osd_health_metrics = std::move(osd_health_metrics);
session->con->send_message(report);
-
- if (stats_period != 0) {
- report_callback = new FunctionContext([this](int r){send_report();});
- timer.add_event_after(stats_period, report_callback);
- }
-
- send_pgstats();
}
void MgrClient::send_pgstats()
bool starting = (stats_period == 0) && (m->stats_period != 0);
stats_period = m->stats_period;
if (starting) {
- send_report();
+ send_stats();
}
m->put();
bool handle_mgr_configure(MMgrConfigure *m);
bool handle_command_reply(MCommandReply *m);
- void send_report();
void send_pgstats();
-
void set_pgstats_cb(std::function<MPGStats*()> cb_)
{
Mutex::Locker l(lock);
int service_daemon_update_status(
const std::map<std::string,std::string>& status);
void update_osd_health(std::vector<OSDHealthMetric>&& metrics);
+
+private:
+ void send_stats();
+ void send_report();
};
#endif
-