]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr: Include daemon details in SLOW_OPS output
authorBrad Hubbard <bhubbard@redhat.com>
Tue, 1 May 2018 01:15:28 +0000 (11:15 +1000)
committerSage Weil <sage@redhat.com>
Fri, 4 May 2018 13:43:08 +0000 (08:43 -0500)
Currently there is no way to see which daemons were involved in a slow
op after the op has cleared. This change allows us to record which
daemons were implicated in the logs.

Partially fixes: http://tracker.ceph.com/issues/23205

Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
(cherry picked from commit b5263176dea6d204c2caa52043cefc94dd5e475f)

src/mgr/DaemonHealthMetricCollector.cc

index fb38e0de9b55af15e10bcd35d8fb7ff899d9b593..beba5dad815a5757c94a121f4de4bb8dcd78a205 100644 (file)
@@ -37,15 +37,20 @@ class SlowOps final : public DaemonHealthMetricCollector {
     if (daemons.empty()) {
       return;
     }
-    static const char* fmt = "%1% slow ops, oldest one blocked for %2% sec";
-    check.summary = boost::str(boost::format(fmt) % value.n1 % value.n2);
+    static const char* fmt = "%1% slow ops, oldest one blocked for %2% sec, %3%";
     ostringstream ss;
     if (daemons.size() > 1) {
-      ss << "daemons " << daemons << " have slow ops.";
+      if (daemons.size() > 10) {
+        ss << "daemons " << vector<DaemonKey>(daemons.begin(), daemons.begin()+10)
+           << "..." << " have slow ops.";
+      } else {
+        ss << "daemons " << daemons << " have slow ops.";
+      }
     } else {
       ss << daemons.front() << " has slow ops";
     }
-    check.detail.push_back(ss.str());
+    check.summary = boost::str(boost::format(fmt) % value.n1 % value.n2 % ss.str());
+    // No detail
   }
   vector<DaemonKey> daemons;
 };