From 35a7c01d51eb075750a5c1d6f4564f06e09816e4 Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Sat, 9 Jun 2018 12:34:00 -0700 Subject: [PATCH] mds: print dir decay counters on hit Signed-off-by: Patrick Donnelly --- src/mds/MDBalancer.cc | 2 +- src/mds/mdstypes.h | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/mds/MDBalancer.cc b/src/mds/MDBalancer.cc index 9c87598eb4a2a..5d236a0c229dc 100644 --- a/src/mds/MDBalancer.cc +++ b/src/mds/MDBalancer.cc @@ -1152,7 +1152,7 @@ void MDBalancer::hit_dir(CDir *dir, int type, int who, double amount) (v > g_conf->mds_bal_split_wr && type == META_POP_IWR); dout(20) << "hit_dir " << type << " pop is " << v << ", frag " << dir->get_frag() - << " size " << dir->get_frag_size() << dendl; + << " size " << dir->get_frag_size() << " " << dir->pop_me << dendl; maybe_fragment(dir, hot); diff --git a/src/mds/mdstypes.h b/src/mds/mdstypes.h index 166a436efaad7..0e802141308c6 100644 --- a/src/mds/mdstypes.h +++ b/src/mds/mdstypes.h @@ -1527,8 +1527,16 @@ inline void decode(dirfrag_load_vec_t& c, bufferlist::const_iterator &p) { inline std::ostream& operator<<(std::ostream& out, const dirfrag_load_vec_t& dl) { - return out << "[" << dl.vec[0].get_last() << "," << dl.vec[1].get_last() - << " " << dl.meta_load() << "]"; + std::ostringstream ss; + ss << std::setprecision(1) << std::fixed + << "[pop" + " IRD:" << dl.vec[0] + << " IWR:" << dl.vec[1] + << " RDR:" << dl.vec[2] + << " FET:" << dl.vec[3] + << " STR:" << dl.vec[4] + << " *LOAD:" << dl.meta_load() << "]"; + return out << ss.str() << std::endl; } -- 2.39.5