From 291cc302a92d215b3a20d3a4efd8e4df0e65b6a5 Mon Sep 17 00:00:00 2001 From: Yingxin Cheng Date: Thu, 25 May 2023 14:09:26 +0800 Subject: [PATCH] crimson/tools/perf_crimson_msgr: collect server reactor utilizations with client Signed-off-by: Yingxin Cheng --- src/crimson/tools/perf_crimson_msgr.cc | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/crimson/tools/perf_crimson_msgr.cc b/src/crimson/tools/perf_crimson_msgr.cc index d6ad00bccb18e..4b8dc851b77f7 100644 --- a/src/crimson/tools/perf_crimson_msgr.cc +++ b/src/crimson/tools/perf_crimson_msgr.cc @@ -308,6 +308,7 @@ static seastar::future<> run( const seastar::shard_id sid; const unsigned id; std::string lname; + const std::optional server_sid; const unsigned jobs; crimson::net::MessengerRef msgr; @@ -351,9 +352,10 @@ static seastar::future<> run( bool stop_send = false; seastar::promise stopped_send_promise; - Client(unsigned jobs, unsigned msg_len, unsigned depth) + Client(unsigned jobs, unsigned msg_len, unsigned depth, std::optional server_sid) : sid{seastar::this_shard_id()}, id{sid + jobs - seastar::smp::count}, + server_sid{server_sid}, jobs{jobs}, msg_len{msg_len}, nr_depth{depth/jobs}, @@ -498,6 +500,7 @@ static seastar::future<> run( unsigned elapsed = 0u; std::vector snaps; std::vector summaries; + std::optional server_reactor_utilization; public: TimerReport(unsigned jobs, unsigned msgtime, unsigned bs) @@ -517,6 +520,10 @@ static seastar::future<> run( return summaries[client_id]; } + void set_server_reactor_utilization(double ru) { + server_reactor_utilization = ru; + } + bool should_stop() const { return elapsed >= msgtime; } @@ -561,6 +568,9 @@ static seastar::future<> run( << std::setw(8) << iops * bytes_of_block / 1048576 << std::setw(8) << (sampled_total_lat_s / sampled_count * 1000) << " -- "; + if (server_reactor_utilization.has_value()) { + sout << *server_reactor_utilization << " -- "; + } for (const auto& snap : snaps) { sout << snap.reactor_utilization << ","; } @@ -604,6 +614,11 @@ static seastar::future<> run( client.get_current_depth(), snap); } + if (client.server_sid.has_value() && + seastar::this_shard_id() == *client.server_sid) { + assert(!client.is_active()); + report.set_server_reactor_utilization(get_reactor_utilization()); + } }).then([&report] { report.report_period(); }); @@ -740,6 +755,10 @@ static seastar::future<> run( }; }; + std::optional server_sid; + if (mode == perf_mode_t::both) { + server_sid = server_conf.core; + } return seastar::when_all( test_state::Server::create( server_conf.core, @@ -747,7 +766,8 @@ static seastar::future<> run( create_sharded( client_conf.jobs, client_conf.block_size, - client_conf.depth), + client_conf.depth, + server_sid), crimson::common::sharded_conf().start( EntityName{}, std::string_view{"ceph"} ).then([] { -- 2.39.5