From: Sage Weil Date: Mon, 6 Aug 2018 18:24:56 +0000 (-0500) Subject: mgr/MgrMap: include mgr age in map printer X-Git-Tag: v14.0.1~357^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e932ba434638330c34f7f908d084aad3d904a663;p=ceph.git mgr/MgrMap: include mgr age in map printer This appears in 'ceph status' output. Signed-off-by: Sage Weil --- diff --git a/src/mon/MgrMap.h b/src/mon/MgrMap.h index ee17f2081d9b..bdfb27d37fc8 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: ";