From: John Spray Date: Tue, 12 Sep 2017 22:39:01 +0000 (+0100) Subject: mon: remove mdsmap-derived perf counters X-Git-Tag: v13.0.1~894^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F17681%2Fhead;p=ceph.git mon: remove mdsmap-derived perf counters Stats collectors that want this kind of information should be looking at the cluster maps to get it. Reasoning: - It's confusing to have two places to get at this sort of status - In the CephFS case, these counters were not that useful as they globbed all filesystems together. - It's awkward to have these stats output as perf counters of ceph-mon daemons, where a naive TSDB collector will not understand that they are really cluster-wide things. Inspired by: http://tracker.ceph.com/issues/21311 Signed-off-by: John Spray --- diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index c3f8b94ba5bc..a13a4da81263 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -119,7 +119,6 @@ void MDSMonitor::update_from_paxos(bool *need_bootstrap) } check_subs(); - update_logger(); } void MDSMonitor::init() @@ -259,26 +258,6 @@ version_t MDSMonitor::get_trim_to() return floor; } -void MDSMonitor::update_logger() -{ - dout(10) << "update_logger" << dendl; - - uint64_t up = 0; - uint64_t in = 0; - uint64_t failed = 0; - for (const auto &i : fsmap.filesystems) { - const MDSMap &mds_map = i.second->mds_map; - - up += mds_map.get_num_up_mds(); - in += mds_map.get_num_in_mds(); - failed += mds_map.get_num_failed_mds(); - } - mon->cluster_logger->set(l_cluster_num_mds_up, up); - mon->cluster_logger->set(l_cluster_num_mds_in, in); - mon->cluster_logger->set(l_cluster_num_mds_failed, failed); - mon->cluster_logger->set(l_cluster_mds_epoch, fsmap.get_epoch()); -} - bool MDSMonitor::preprocess_query(MonOpRequestRef op) { op->mark_mdsmon_event(__func__); @@ -823,7 +802,6 @@ void MDSMonitor::_updated(MonOpRequestRef op) void MDSMonitor::on_active() { tick(); - update_logger(); if (mon->is_leader()) { mon->clog->debug() << "fsmap " << fsmap; diff --git a/src/mon/MDSMonitor.h b/src/mon/MDSMonitor.h index 0bf51adfe60d..36a813f1b257 100644 --- a/src/mon/MDSMonitor.h +++ b/src/mon/MDSMonitor.h @@ -76,7 +76,6 @@ class MDSMonitor : public PaxosService { // my helpers void print_map(FSMap &m, int dbl=7); - void update_logger(); void _updated(MonOpRequestRef op); diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 93fa0fad5864..fd962eba789e 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -586,10 +586,6 @@ int Monitor::preinit() pcb.add_u64(l_cluster_num_object_misplaced, "num_object_misplaced", "Misplaced (wrong location in the cluster) objects"); pcb.add_u64(l_cluster_num_object_unfound, "num_object_unfound", "Unfound objects"); pcb.add_u64(l_cluster_num_bytes, "num_bytes", "Size of all objects"); - pcb.add_u64(l_cluster_num_mds_up, "num_mds_up", "MDSs that are up"); - pcb.add_u64(l_cluster_num_mds_in, "num_mds_in", "MDS in state \"in\" (they are in cluster)"); - pcb.add_u64(l_cluster_num_mds_failed, "num_mds_failed", "Failed MDS"); - pcb.add_u64(l_cluster_mds_epoch, "mds_epoch", "Current epoch of MDS map"); cluster_logger = pcb.create_perf_counters(); } diff --git a/src/mon/Monitor.h b/src/mon/Monitor.h index 130cf032f27c..6b3307f0d3b6 100644 --- a/src/mon/Monitor.h +++ b/src/mon/Monitor.h @@ -76,10 +76,6 @@ enum { l_cluster_num_object_misplaced, l_cluster_num_object_unfound, l_cluster_num_bytes, - l_cluster_num_mds_up, - l_cluster_num_mds_in, - l_cluster_num_mds_failed, - l_cluster_mds_epoch, l_cluster_last, };