From b11b061b4930235b540dae3aa316797e55563929 Mon Sep 17 00:00:00 2001 From: Yingxin Cheng Date: Thu, 4 Jul 2024 14:03:30 +0800 Subject: [PATCH] crimson/osd: report the average reactor utilization Signed-off-by: Yingxin Cheng (cherry picked from commit d0450f9affc0bf6cb7d9f10238d060b5ea8a094f) --- src/crimson/osd/osd.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/crimson/osd/osd.cc b/src/crimson/osd/osd.cc index b2621f0bf8f..e75e4b2e365 100644 --- a/src/crimson/osd/osd.cc +++ b/src/crimson/osd/osd.cc @@ -411,11 +411,16 @@ seastar::future<> OSD::start() shard_stats[seastar::this_shard_id()] = stats; }).then([this, FNAME] { std::ostringstream oss; + double agg_ru = 0; + int cnt = 0; for (const auto &stats : shard_stats) { + agg_ru += stats.reactor_utilization; + ++cnt; oss << int(stats.reactor_utilization); oss << ","; } - INFO("reactor_utilizations: {}", oss.str()); + INFO("reactor_utilizations: {}({})", + int(agg_ru/cnt), oss.str()); }); }); gate.dispatch_in_background("stats_store", *this, [this] { -- 2.39.5