]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: add counters for uninlining
authorMilind Changire <mchangir@redhat.com>
Mon, 18 Jul 2022 06:15:06 +0000 (11:45 +0530)
committerMilind Changire <mchangir@redhat.com>
Wed, 28 Aug 2024 07:03:39 +0000 (12:33 +0530)
Signed-off-by: Milind Changire <mchangir@redhat.com>
src/mds/MDCache.cc
src/mds/MDCache.h

index ab5f9c96105805034b00d088c4ec683792184062..ec4acae33031150076bd5ebfb21947de26c6f32e 100644 (file)
@@ -13186,11 +13186,14 @@ class C_MDC_DataUninlinedSubmitted : public MDCacheLogContext {
     auto mds = get_mds(); // to keep dout happy
     auto in = mds->server->rdlock_path_pin_ref(mdr, true);
 
+    ceph_assert(in != nullptr);
+
     if (r) {
       dout(20) << "(uninline_data) log submission failed; r=" << r
-              << " (" << cpp_strerror(r) << ")" << dendl;
+              << " (" << cpp_strerror(r) << ") for " << *in << dendl;
     } else {
-      dout(20) << "(uninline_data) log submission succeeded" << dendl;
+      dout(20) << "(uninline_data) log submission succeeded for " << *in << dendl;
+      in->mdcache->logger->inc(l_mdc_uninline_succeeded);
     }
 
     mdr->apply();
@@ -13215,7 +13218,8 @@ struct C_IO_DataUninlined : public MDSIOContext {
     // return faster if operation has failed (non-zero) status
     if (r) {
       derr << "(uninline_data) mutation failed: r=" << r
-          << "(" << cpp_strerror(r) << ")" << dendl;
+          << " (" << cpp_strerror(r) << ") for " << *in << dendl;
+      in->mdcache->logger->inc(l_mdc_uninline_write_failed);
       mds->server->respond_to_request(mdr, r);
       return;
     }
@@ -13279,6 +13283,8 @@ void MDCache::uninline_data_work(MDRequestRef mdr)
     return;
   }
 
+  logger->inc(l_mdc_uninline_started);
+
   auto ino = [&]() { return in->ino(); };
   auto pi = in->get_projected_inode();
   auto objecter = mds->objecter;
@@ -13706,6 +13712,14 @@ void MDCache::register_perfcounters()
     pcb.add_u64_counter(l_mdss_ireq_inodestats, "ireq_inodestats",
                         "Internal Request type inode stats");
 
+    // uninline op stats
+    pcb.add_u64_counter(l_mdc_uninline_started, "uninline_started",
+                        "Internal Counter type uninline started");
+    pcb.add_u64_counter(l_mdc_uninline_succeeded, "uninline_succeeded",
+                        "Internal Counter type uninline succeeded");
+    pcb.add_u64_counter(l_mdc_uninline_write_failed, "uninline_write_failed",
+                        "Internal Counter type uninline write failed");
+
     logger.reset(pcb.create_perf_counters());
     g_ceph_context->get_perfcounters_collection()->add(logger.get());
     recovery_queue.set_logger(logger.get());
index c54d9e0cf287c5f969fafd13ec5bb23797308261..0b01c9ab8594ce6491b2a8b159d4e83a445c23de 100644 (file)
@@ -118,6 +118,10 @@ enum {
   l_mdss_ireq_fragstats,
   l_mdss_ireq_inodestats,
 
+  l_mdc_uninline_started,
+  l_mdc_uninline_succeeded,
+  l_mdc_uninline_write_failed,
+
   l_mdc_last,
 };
 
@@ -1444,6 +1448,8 @@ private:
   friend class C_MDC_FragmentCommit;
   friend class C_MDC_FragmentRollback;
   friend class C_IO_MDC_FragmentPurgeOld;
+  friend class C_IO_DataUninlined;
+  friend class C_MDC_DataUninlinedSubmitted;
 
   // -- subtrees --
   static const unsigned int SUBTREES_COUNT_THRESHOLD = 5;