]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: add 'osd utilization' command
authorSage Weil <sage@redhat.com>
Wed, 2 Mar 2016 19:00:15 +0000 (14:00 -0500)
committerSage Weil <sage@redhat.com>
Thu, 3 Mar 2016 18:49:05 +0000 (13:49 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/MonCommands.h
src/mon/OSDMonitor.cc

index be6f99a1c97a083477e336cc7b199e4aef6d657e..56d4d2cdac85a4755f18114448e50bba3affcad4 100644 (file)
@@ -701,6 +701,9 @@ COMMAND("osd pool stats " \
         "name=name,type=CephString,req=false",
         "obtain stats from all pools, or from specified pool",
         "osd", "r", "cli,rest")
+COMMAND("osd utilization",
+       "get basic pg distribution stats",
+       "osd", "r", "cli,rest")
 COMMAND("osd reweight-by-utilization " \
        "name=oload,type=CephInt,range=100,req=false " \
        "name=max_change,type=CephFloat,req=false "                     \
index edb7cd6e791518e2a148c0468de9a5ac3c504a16..64065ef13626f9e412791ace4d3d722532500cd0 100644 (file)
@@ -3147,6 +3147,15 @@ bool OSDMonitor::preprocess_command(MonOpRequestRef op)
       ds << "max_osd = " << osdmap.get_max_osd() << " in epoch " << osdmap.get_epoch();
       rdata.append(ds);
     }
+  } else if (prefix == "osd utilization") {
+    string out;
+    osdmap.summarize_mapping_stats(NULL, NULL, &out, f.get());
+    if (f)
+      f->flush(rdata);
+    else
+      rdata.append(out);
+    r = 0;
+    goto reply;
   } else if (prefix  == "osd find") {
     int64_t osd;
     if (!cmd_getval(g_ceph_context, cmdmap, "id", osd)) {