]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: add perf counters relating to replication
authorPatrick Donnelly <pdonnell@redhat.com>
Thu, 9 Jun 2022 17:36:20 +0000 (13:36 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Sat, 11 Jun 2022 13:50:21 +0000 (09:50 -0400)
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/mds/MDCache.cc
src/mds/MDCache.h

index 81167e363b924da0326f317c1d40e75a0aeba404..2608c22c95e793190e7930dc112fc42140521474 100644 (file)
@@ -10136,6 +10136,7 @@ void MDCache::_send_discover(discover_info_t& d)
 {
   auto dis = make_message<MDiscover>(d.ino, d.frag, d.snap, d.want_path,
                                     d.want_base_dir, d.path_locked);
+  logger->inc(l_mdc_dir_send_discover);
   dis->set_tid(d.tid);
   mds->send_message_mds(dis, d.mds);
 }
@@ -10326,6 +10327,8 @@ void MDCache::handle_discover(const cref_t<MDiscover> &dis)
 
   snapid_t snapid = dis->get_snapid();
 
+  logger->inc(l_mdc_dir_handle_discover);
+
   // get started.
   if (MDS_INO_IS_BASE(dis->get_base_ino()) &&
       !dis->wants_base_dir() && dis->get_want().depth() == 0) {
@@ -11036,6 +11039,7 @@ int MDCache::send_dir_updates(CDir *dir, bool bcast)
     //if (*it == except) continue;
     dout(7) << "sending dir_update on " << *dir << " to " << *it << dendl;
 
+    logger->inc(l_mdc_dir_update);
     mds->send_message_mds(make_message<MDirUpdate>(mds->get_nodeid(), dir->dirfrag(), dir->dir_rep, dir_rep_set, path, bcast), *it);
   }
 
@@ -11046,6 +11050,7 @@ void MDCache::handle_dir_update(const cref_t<MDirUpdate> &m)
 {
   dirfrag_t df = m->get_dirfrag();
   CDir *dir = get_dirfrag(df);
+  logger->inc(l_mdc_dir_update_receipt);
   if (!dir) {
     dout(5) << "dir_update on " << df << ", don't have it" << dendl;
 
@@ -11058,6 +11063,7 @@ void MDCache::handle_dir_update(const cref_t<MDirUpdate> &m)
       CInode *in;
       filepath path = m->get_path();
       dout(5) << "trying discover on dir_update for " << path << dendl;
+      logger->inc(l_mdc_dir_try_discover);
       CF_MDS_RetryMessageFactory cf(mds, m);
       MDRequestRef null_ref;
       int r = path_traverse(null_ref, cf, path, MDS_TRAVERSE_DISCOVER, &trace, &in);
@@ -13281,6 +13287,17 @@ void MDCache::register_perfcounters()
 {
     PerfCountersBuilder pcb(g_ceph_context, "mds_cache", l_mdc_first, l_mdc_last);
 
+    pcb.add_u64_counter(l_mdc_dir_update, "dir_update",
+                        "Directory replication directives");
+    pcb.add_u64_counter(l_mdc_dir_update_receipt, "dir_update_receipt",
+                        "Directory replication directives received");
+    pcb.add_u64_counter(l_mdc_dir_try_discover, "dir_try_discover",
+                        "Directory replication attempt to discover");
+    pcb.add_u64_counter(l_mdc_dir_send_discover, "dir_send_discover",
+                        "Directory replication discovery message sent");
+    pcb.add_u64_counter(l_mdc_dir_handle_discover, "dir_handle_discover",
+                        "Directory replication discovery message handled");
+
     // Stray/purge statistics
     pcb.add_u64(l_mdc_num_strays, "num_strays", "Stray dentries", "stry",
                 PerfCountersBuilder::PRIO_INTERESTING);
index 445b5edcbcfd899958a55a383db760ae86f1b59d..bd109e2549075b53e4f02d9264cb248fea6c52a9 100644 (file)
@@ -72,6 +72,14 @@ class ESubtreeMap;
 
 enum {
   l_mdc_first = 3000,
+
+  // dir updates for replication
+  l_mdc_dir_update,
+  l_mdc_dir_update_receipt,
+  l_mdc_dir_try_discover,
+  l_mdc_dir_send_discover,
+  l_mdc_dir_handle_discover,
+
   // How many inodes currently in stray dentries
   l_mdc_num_strays,
   // How many stray dentries are currently delayed for purge due to refs