mon/HealthMonitor.cc \
mon/DataHealthService.cc \
mon/ConfigKeyService.cc \
- common/util.cc
+ common/util.cc \
+ common/TextTable.cc
libmon_a_CXXFLAGS= ${AM_CXXFLAGS}
noinst_LIBRARIES += libmon.a
COMMAND("osd getcrushmap " \
"name=epoch,type=CephInt,range=0,req=false", \
"get CRUSH map", "osd", "r", "cli,rest")
+COMMAND("osd perf", \
+ "print dump of OSD perf summary stats", \
+ "osd", \
+ "r", \
+ "cli,rest")
COMMAND("osd getmaxosd", "show largest OSD id", "osd", "r", "cli,rest")
COMMAND("osd find " \
"name=id,type=CephInt,range=0", \
prefix == "osd tree" ||
prefix == "osd ls" ||
prefix == "osd getmap" ||
- prefix == "osd getcrushmap") {
+ prefix == "osd getcrushmap" ||
+ prefix == "osd perf") {
string val;
epoch_t epoch = 0;
} else if (prefix == "osd getcrushmap") {
p->crush->encode(rdata);
ss << "got crush map from osdmap epoch " << p->get_epoch();
+ } else if (prefix == "osd perf") {
+ const PGMap &pgm = mon->pgmon()->pg_map;
+ if (f) {
+ f->open_object_section("osdstats");
+ pgm.dump_osd_perf_stats(f.get());
+ f->close_section();
+ f->flush(ds);
+ } else {
+ pgm.print_osd_perf_stats(&ds);
+ }
+ rdata.append(ds);
}
if (p != &osdmap)
delete p;
#define dout_subsys ceph_subsys_mon
#include "common/debug.h"
+#include "common/TextTable.h"
#include "include/stringify.h"
#include "common/Formatter.h"
#include "include/ceph_features.h"
dump_pg_stats_plain(ss, stuck_pg_stats);
}
+void PGMap::dump_osd_perf_stats(Formatter *f) const
+{
+ f->open_array_section("osd_perf_infos");
+ for (hash_map<int32_t, osd_stat_t>::const_iterator i = osd_stat.begin();
+ i != osd_stat.end();
+ ++i) {
+ f->open_object_section("osd");
+ f->dump_int("id", i->first);
+ {
+ f->open_object_section("perf_stats");
+ i->second.fs_perf_stat.dump(f);
+ f->close_section();
+ }
+ f->close_section();
+ }
+ f->close_section();
+}
+void PGMap::print_osd_perf_stats(std::ostream *ss) const
+{
+ TextTable tab;
+ tab.define_column("osdid", TextTable::LEFT, TextTable::RIGHT);
+ tab.define_column("fs_commit_latency(ms)", TextTable::LEFT, TextTable::RIGHT);
+ tab.define_column("fs_apply_latency(ms)", TextTable::LEFT, TextTable::RIGHT);
+ for (hash_map<int32_t, osd_stat_t>::const_iterator i = osd_stat.begin();
+ i != osd_stat.end();
+ ++i) {
+ tab << i->first;
+ tab << i->second.fs_perf_stat.filestore_commit_latency;
+ tab << i->second.fs_perf_stat.filestore_apply_latency;
+ tab << TextTable::endrow;
+ }
+ (*ss) << tab;
+}
+
void PGMap::recovery_summary(Formatter *f, ostream *out) const
{
bool first = true;
void dump(ostream& ss) const;
+ void dump_osd_perf_stats(Formatter *f) const;
+ void print_osd_perf_stats(std::ostream *ss) const;
+
void recovery_summary(Formatter *f, ostream *out) const;
void print_summary(Formatter *f, ostream *out) const;