From e932ba434638330c34f7f908d084aad3d904a663 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 6 Aug 2018 13:24:56 -0500 Subject: [PATCH] mgr/MgrMap: include mgr age in map printer This appears in 'ceph status' output. Signed-off-by: Sage Weil --- src/mon/MgrMap.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/mon/MgrMap.h b/src/mon/MgrMap.h index ee17f2081d9..bdfb27d37fc 100644 --- a/src/mon/MgrMap.h +++ b/src/mon/MgrMap.h @@ -366,16 +366,24 @@ public: if (f) { dump(f); } else { + utime_t now = ceph_clock_now(); if (get_active_gid() != 0) { *ss << get_active_name(); if (!available) { // If the daemon hasn't gone active yet, indicate that. - *ss << "(active, starting)"; + *ss << "(active, starting"; } else { - *ss << "(active)"; + *ss << "(active"; } + if (active_change) { + *ss << ", since " << utimespan_str(now - active_change); + } + *ss << ")"; } else { *ss << "no daemons active"; + if (active_change) { + *ss << " (since " << utimespan_str(now - active_change) << ")"; + } } if (standbys.size()) { *ss << ", standbys: "; -- 2.47.3