]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr: Include daemon details in SLOW_OPS output 21750/head
authorBrad Hubbard <bhubbard@redhat.com>
Tue, 1 May 2018 01:15:28 +0000 (11:15 +1000)
committerBrad Hubbard <bhubbard@redhat.com>
Thu, 3 May 2018 04:52:39 +0000 (14:52 +1000)
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>
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;
 };