]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/MgrMap: include mgr age in map printer
authorSage Weil <sage@redhat.com>
Mon, 6 Aug 2018 18:24:56 +0000 (13:24 -0500)
committerSage Weil <sage@redhat.com>
Thu, 6 Sep 2018 15:28:45 +0000 (10:28 -0500)
This appears in 'ceph status' output.

Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/MgrMap.h

index ee17f2081d9b54100f8bae34a6bd769a468ce679..bdfb27d37fc8277db33ceb9ea8f2784297f3624c 100644 (file)
@@ -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: ";