]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mon/HealthMonitor: add gather_all_health_checks helper
authorSage Weil <sage@redhat.com>
Wed, 31 Jul 2019 05:05:04 +0000 (00:05 -0500)
committerSage Weil <sage@redhat.com>
Thu, 15 Aug 2019 01:40:08 +0000 (20:40 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/HealthMonitor.cc
src/mon/HealthMonitor.h
src/mon/Monitor.cc

index 7945365ad04da6ead2f2be3be52d1e64f7fbaa2a..b028adb8afb2264fea0284a98b9fb63074ee77e3 100644 (file)
@@ -379,6 +379,13 @@ bool HealthMonitor::check_mutes()
   return changed;
 }
 
+void HealthMonitor::gather_all_health_checks(health_check_map_t *all)
+{
+  for (auto& svc : mon->paxos_service) {
+    all->merge(svc->get_health_checks());
+  }
+}
+
 bool HealthMonitor::check_member_health()
 {
   dout(20) << __func__ << dendl;
index a9315331bd2e2bd204a891128e56dcf6fde2992f..a80d32da94ef0280420822ae5cf549b77a4ff74a 100644 (file)
@@ -58,6 +58,8 @@ public:
 
   void tick() override;
 
+  void gather_all_health_checks(health_check_map_t *all);
+
   /**
    * @} // HealthMonitor_Inherited_h
    */
index d81bbabec205bb59eef3de9fbd50ac7f8cb6122b..96c8da73dc634445dbe809f31f5d6931c01d1e46 100644 (file)
@@ -2785,9 +2785,7 @@ health_status_t Monitor::get_health_status(
   const char *sep2)
 {
   health_check_map_t all;
-  for (auto& svc : paxos_service) {
-    all.merge(svc->get_health_checks());
-  }
+  healthmon()->gather_all_health_checks(&all);
   health_status_t r = HEALTH_OK;
   for (auto& p : all.checks) {
     if (!healthmon()->mutes.count(p.first)) {