]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: wire up "histogram dump" to `tell`
authorJohn Spray <john.spray@redhat.com>
Sun, 5 Feb 2017 11:26:24 +0000 (11:26 +0000)
committerDan Mick <dan.mick@redhat.com>
Fri, 19 May 2017 05:09:07 +0000 (22:09 -0700)
...so that mgr modules can get at it.

Signed-off-by: John Spray <john.spray@redhat.com>
src/osd/OSD.cc

index 72afa48a97ec84ca5d3b956ad2d273191973428d..87177a3d7596074ef0fdd744c1af570025310d17 100644 (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;