osd: wire up "histogram dump" to tell

...so that mgr modules can get at it.

Signed-off-by: John Spray <john.spray@redhat.com>
This commit is contained in:
John Spray 2017-02-05 11:26:24 +00:00 committed by Dan Mick
parent f6b388a3a3
commit 80dc6a1ec3

View File

@ -6013,6 +6013,11 @@ COMMAND("list_missing " \
"name=offset,type=CephString,req=false",
"list missing objects on this pg, perhaps starting at an offset given in JSON",
"osd", "r", "cli,rest")
COMMAND("perf histogram dump "
"name=logger,type=CephString,req=false "
"name=counter,type=CephString,req=false",
"Get histogram data",
"osd", "r", "cli,rest")
// tell <osd.n> commands. Validation of osd.n must be special-cased in client
COMMAND("version", "report version of OSD", "osd", "r", "cli,rest")
@ -6449,6 +6454,18 @@ void OSD::do_command(Connection *con, ceph_tid_t tid, vector<string>& cmd, buffe
pg_recovery_stats.reset();
}
else if (prefix == "perf histogram dump") {
std::string logger;
std::string counter;
cmd_getval(cct, cmdmap, "logger", logger);
cmd_getval(cct, cmdmap, "counter", counter);
if (f) {
cct->get_perfcounters_collection()->dump_formatted_histograms(
f.get(), false, logger, counter);
f->flush(ds);
}
}
else {
ss << "unrecognized command! " << cmd;
r = -EINVAL;