From 1600ff60d6eeec1b70fb7d015021d257adc20b29 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 31 Jul 2019 00:05:04 -0500 Subject: [PATCH] mon/HealthMonitor: add gather_all_health_checks helper Signed-off-by: Sage Weil --- src/mon/HealthMonitor.cc | 7 +++++++ src/mon/HealthMonitor.h | 2 ++ src/mon/Monitor.cc | 4 +--- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/mon/HealthMonitor.cc b/src/mon/HealthMonitor.cc index 7945365ad04..b028adb8afb 100644 --- a/src/mon/HealthMonitor.cc +++ b/src/mon/HealthMonitor.cc @@ -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; diff --git a/src/mon/HealthMonitor.h b/src/mon/HealthMonitor.h index a9315331bd2..a80d32da94e 100644 --- a/src/mon/HealthMonitor.h +++ b/src/mon/HealthMonitor.h @@ -58,6 +58,8 @@ public: void tick() override; + void gather_all_health_checks(health_check_map_t *all); + /** * @} // HealthMonitor_Inherited_h */ diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index d81bbabec20..96c8da73dc6 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -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)) { -- 2.39.5