]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/mgr/MgrClient.h
update sources to 12.2.10
[ceph.git] / ceph / src / mgr / MgrClient.h
index f9385b8be6df53dad221dd043580ebe555d3c9fc..ef1dd058b4221808dd189b19fd79842f105318c4 100644 (file)
 #ifndef MGR_CLIENT_H_
 #define MGR_CLIENT_H_
 
+#include "msg/Connection.h"
 #include "msg/Dispatcher.h"
 #include "mon/MgrMap.h"
-
-#include "msg/Connection.h"
+#include "osd/OSDHealthMetric.h"
 
 #include "common/perf_counters.h"
 #include "common/Timer.h"
@@ -59,6 +59,7 @@ protected:
   Mutex lock = {"MgrClient::lock"};
 
   uint32_t stats_period = 0;
+  uint32_t stats_threshold = 0;
   SafeTimer timer;
 
   CommandTable<MgrCommand> command_table;
@@ -72,7 +73,16 @@ protected:
   // our reports (hook for use by OSD)
   std::function<MPGStats*()> pgstats_cb;
 
+  // for service registration and beacon
+  bool service_daemon = false;
+  bool daemon_dirty_status = false;
+  std::string service_name, daemon_name;
+  std::map<std::string,std::string> daemon_metadata;
+  std::map<std::string,std::string> daemon_status;
+  std::vector<OSDHealthMetric> osd_health_metrics;
+
   void reconnect();
+  void _send_open();
 
 public:
   MgrClient(CephContext *cct_, Messenger *msgr_);
@@ -91,8 +101,7 @@ public:
   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);
@@ -102,7 +111,19 @@ public:
   int start_command(const vector<string>& cmd, const bufferlist& inbl,
                    bufferlist *outbl, string *outs,
                    Context *onfinish);
+
+  int service_daemon_register(
+    const std::string& service,
+    const std::string& name,
+    const std::map<std::string,std::string>& metadata);
+  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_pgstats();
+  void _send_report();
 };
 
 #endif
-