]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: gate stats reporting
authorYingxin Cheng <yingxin.cheng@intel.com>
Fri, 17 May 2024 09:03:14 +0000 (17:03 +0800)
committerMatan Breizman <mbreizma@redhat.com>
Sun, 16 Jun 2024 10:22:27 +0000 (13:22 +0300)
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
(cherry picked from commit e3d60f0ccf614d77fde46fd4c7b9a184d52f1618)

src/crimson/osd/osd.cc

index 6b43abca51268aa854dc2ff77aefc3ed53b89476..0a40a7158f8a700523b05a46494c82df28652bd4 100644 (file)
@@ -389,17 +389,19 @@ seastar::future<> OSD::start()
     if (stats_seconds > 0) {
       shard_stats.resize(seastar::smp::count);
       stats_timer.set_callback([this, FNAME] {
-        std::ignore = shard_services.invoke_on_all(
-          [this](auto &local_service) {
-          auto stats = local_service.report_stats();
-          shard_stats[seastar::this_shard_id()] = stats;
-        }).then([this, FNAME] {
-          std::ostringstream oss;
-          for (const auto &stats : shard_stats) {
-            oss << int(stats.reactor_utilization);
-            oss << ",";
-          }
-          INFO("reactor_utilizations: {}", oss.str());
+        gate.dispatch_in_background("stats_osd", *this, [this, FNAME] {
+          return shard_services.invoke_on_all(
+            [this](auto &local_service) {
+            auto stats = local_service.report_stats();
+            shard_stats[seastar::this_shard_id()] = stats;
+          }).then([this, FNAME] {
+            std::ostringstream oss;
+            for (const auto &stats : shard_stats) {
+              oss << int(stats.reactor_utilization);
+              oss << ",";
+            }
+            INFO("reactor_utilizations: {}", oss.str());
+          });
         });
       });
       stats_timer.arm_periodic(std::chrono::seconds(stats_seconds));