From 7df0d56ac0ff27ebff363e5bf498d2d6285ab384 Mon Sep 17 00:00:00 2001 From: Neha Ojha Date: Fri, 9 Jul 2021 19:26:01 +0000 Subject: [PATCH] mon/PGMap: remove get_stuck_counts because there are no callers The only callers were removed in 729a08923fb4403b88baafa0ae75643cfefe6510, as a part of the broader health reporting improvements. Signed-off-by: Neha Ojha --- src/mon/PGMap.cc | 51 ------------------------------------------------ src/mon/PGMap.h | 1 - 2 files changed, 52 deletions(-) diff --git a/src/mon/PGMap.cc b/src/mon/PGMap.cc index 057c79dca36d4..91f18668a9bd1 100644 --- a/src/mon/PGMap.cc +++ b/src/mon/PGMap.cc @@ -1923,57 +1923,6 @@ void PGMap::get_stuck_stats( } } -bool PGMap::get_stuck_counts(const utime_t cutoff, map& note) const -{ - int inactive = 0; - int unclean = 0; - int degraded = 0; - int undersized = 0; - int stale = 0; - - for (auto i = pg_stat.begin(); - i != pg_stat.end(); - ++i) { - if (! (i->second.state & PG_STATE_ACTIVE)) { - if (i->second.last_active < cutoff) - ++inactive; - } - if (! (i->second.state & PG_STATE_CLEAN)) { - if (i->second.last_clean < cutoff) - ++unclean; - } - if (i->second.state & PG_STATE_DEGRADED) { - if (i->second.last_undegraded < cutoff) - ++degraded; - } - if (i->second.state & PG_STATE_UNDERSIZED) { - if (i->second.last_fullsized < cutoff) - ++undersized; - } - if (i->second.state & PG_STATE_STALE) { - if (i->second.last_unstale < cutoff) - ++stale; - } - } - - if (inactive) - note["stuck inactive"] = inactive; - - if (unclean) - note["stuck unclean"] = unclean; - - if (undersized) - note["stuck undersized"] = undersized; - - if (degraded) - note["stuck degraded"] = degraded; - - if (stale) - note["stuck stale"] = stale; - - return inactive || unclean || undersized || degraded || stale; -} - void PGMap::dump_stuck(ceph::Formatter *f, int types, utime_t cutoff) const { mempool::pgmap::unordered_map stuck_pg_stats; diff --git a/src/mon/PGMap.h b/src/mon/PGMap.h index 3bb0c3e09f52c..c592f338ecb33 100644 --- a/src/mon/PGMap.h +++ b/src/mon/PGMap.h @@ -467,7 +467,6 @@ public: void get_stuck_stats( int types, const utime_t cutoff, mempool::pgmap::unordered_map& stuck_pgs) const; - bool get_stuck_counts(const utime_t cutoff, std::map& note) const; void dump_stuck(ceph::Formatter *f, int types, utime_t cutoff) const; void dump_stuck_plain(std::ostream& ss, int types, utime_t cutoff) const; int dump_stuck_pg_stats(std::stringstream &ds, -- 2.39.5