From 9af3bc94fe33620ffb4b05596cda057f5da9215b Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Fri, 15 Aug 2025 16:15:20 -0700 Subject: [PATCH] crimson/.../store-bench: support dumping seastar metrics Signed-off-by: Samuel Just --- src/crimson/tools/store_bench/store-bench.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/crimson/tools/store_bench/store-bench.cc b/src/crimson/tools/store_bench/store-bench.cc index e5f28ed28dda..879893afed90 100644 --- a/src/crimson/tools/store_bench/store-bench.cc +++ b/src/crimson/tools/store_bench/store-bench.cc @@ -88,6 +88,7 @@ private: unsigned duration = 0; public: unsigned num_concurrent_io = 16; + bool dump_metrics = false; std::chrono::duration get_duration() const { return std::chrono::seconds(duration); } @@ -100,6 +101,8 @@ public: ("duration", po::value(&duration)->required(), "how long in seconds the actual testing loop runs " "for") + ("dump-metrics", po::bool_switch(&dump_metrics), + "Dump JSON formatted metrics to stdout") ; return ret; } @@ -752,6 +755,14 @@ int main(int argc, char **argv) { } f.close_section(); } + if (common_options.dump_metrics) { + f.open_array_section("metrics_values"); + crimson::metrics::dump_metric_value_map( + seastar::scollectd::get_value_map(), + &f, + [](const auto &) { return true; }); + f.close_section(); + } f.close_section(); f.flush(std::cout); -- 2.47.3