]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: dump scrub stats during scrub status
authorMilind Changire <mchangir@redhat.com>
Mon, 31 Oct 2022 05:48:58 +0000 (11:18 +0530)
committerMilind Changire <mchangir@redhat.com>
Wed, 28 Aug 2024 07:49:39 +0000 (13:19 +0530)
Signed-off-by: Milind Changire <mchangir@redhat.com>
src/mds/ScrubStack.cc

index 63bf584b2bcf9af6d0702d7cb30777a3277e634a..a4e7c4ee3758ff04fe69160bb948f22825d5c380 100644 (file)
@@ -723,6 +723,34 @@ void ScrubStack::scrub_status(Formatter *f) {
     f->close_section(); // scrub id
   }
   f->close_section(); // scrubs
+
+  if (mds_scrub_stats.size()) {
+    f->open_object_section("scrub_stats");
+    for (auto& [tag, ctrs] : mds_scrub_stats[0].counters) {
+      uint64_t started = 0;
+      uint64_t passed = 0;
+      uint64_t failed = 0;
+      for (auto& stats : mds_scrub_stats) {
+       if (auto it = stats.counters.find(tag); it != stats.counters.end()) {
+         auto& [t, c] = *it;
+         started += c.uninline_started;
+         passed += c.uninline_passed;
+         failed += c.uninline_failed;
+       }
+      }
+      f->open_object_section(tag);
+      {
+       f->dump_stream("start_time") << ctrs.start_time;
+       f->dump_string("path", (ctrs.origin_path == "" ? "/"s : ctrs.origin_path));
+       f->dump_int("uninline_started", started);
+       f->dump_int("uninline_passed", passed);
+       f->dump_int("uninline_failed", failed);
+      }
+      f->close_section(); // tag
+    }
+    f->close_section(); // scrub_stats
+  }
+
   f->close_section(); // result
 }