#include "messages/MMgrConfigure.h"
#include "messages/MCommand.h"
#include "messages/MCommandReply.h"
+#include "messages/MPGStats.h"
#define dout_subsys ceph_subsys_mgrc
#undef dout_prefix
report_callback = new C_StdFunction([this](){send_report();});
timer.add_event_after(stats_period, report_callback);
}
+
+ if (pgstats_cb) {
+ MPGStats *m_stats = pgstats_cb();
+ session->con->send_message(m_stats);
+ }
}
bool MgrClient::handle_mgr_configure(MMgrConfigure *m)
class MMgrConfigure;
class Messenger;
class MCommandReply;
+class MPGStats;
class MgrSessionState
{
list<Cond*> waiting_for_session;
Context *report_callback;
+ // If provided, use this to compose an MPGStats to send with
+ // our reports (hook for use by OSD)
+ std::function<MPGStats*()> pgstats_cb;
+
public:
MgrClient(CephContext *cct_, Messenger *msgr_);
void send_report();
+ void set_pgstats_cb(std::function<MPGStats*()> cb_)
+ {
+ pgstats_cb = cb_;
+ }
+
int start_command(const vector<string>& cmd, const bufferlist& inbl,
bufferlist *outbl, string *outs,
Context *onfinish);