Skip to content

Commit

Permalink
mgr: Include daemon details in SLOW_OPS output
Browse files Browse the repository at this point in the history
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 <[email protected]>
(cherry picked from commit b526317)
  • Loading branch information
badone authored and liewegas committed May 4, 2018
1 parent 4f98ff5 commit 303e71f
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/mgr/DaemonHealthMetricCollector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down

0 comments on commit 303e71f

Please sign in to comment.