Skip to content

Commit a8d0712

Browse files
committed
crimson/os/seastore: improve store stats
Calculate average values and remove verbose per-shard data. Signed-off-by: Yingxin Cheng <[email protected]>
1 parent d0450f9 commit a8d0712

File tree

1 file changed

+16
-19
lines changed

1 file changed

+16
-19
lines changed

src/crimson/os/seastore/seastore.cc

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -600,37 +600,34 @@ seastar::future<> SeaStore::report_stats()
600600
}
601601
constexpr const char* dfmt = "{:.2f}";
602602
auto d_ts_num_io = static_cast<double>(ts.num_io);
603+
603604
std::ostringstream oss_iops;
604-
oss_iops << "device IOPS:"
605-
<< fmt::format(dfmt, ts.num_io/seconds)
605+
auto iops = ts.num_io/seconds;
606+
oss_iops << "device IOPS: "
607+
<< fmt::format(dfmt, iops)
608+
<< " "
609+
<< fmt::format(dfmt, iops/shard_device_stats.size())
606610
<< "(";
607-
std::ostringstream oss_depth;
608-
oss_depth << "device per-writer depth:"
609-
<< fmt::format(dfmt, ts.total_depth/d_ts_num_io)
610-
<< "(";
611+
611612
std::ostringstream oss_bd;
612-
oss_bd << "device bandwidth(MiB):"
613-
<< fmt::format(dfmt, ts.total_bytes/seconds/(1<<20))
613+
auto bd_mb = ts.total_bytes/seconds/(1<<20);
614+
oss_bd << "device bandwidth(MiB): "
615+
<< fmt::format(dfmt, bd_mb)
616+
<< " "
617+
<< fmt::format(dfmt, bd_mb/shard_device_stats.size())
614618
<< "(";
615-
std::ostringstream oss_iosz;
616-
oss_iosz << "device IO size(B):"
617-
<< fmt::format(dfmt, ts.total_bytes/d_ts_num_io)
618-
<< "(";
619+
619620
for (const auto &s : shard_device_stats) {
620-
auto d_s_num_io = static_cast<double>(s.num_io);
621621
oss_iops << fmt::format(dfmt, s.num_io/seconds) << ",";
622-
oss_depth << fmt::format(dfmt, s.total_depth/d_s_num_io) << ",";
623622
oss_bd << fmt::format(dfmt, s.total_bytes/seconds/(1<<20)) << ",";
624-
oss_iosz << fmt::format(dfmt, s.total_bytes/d_s_num_io) << ",";
625623
}
626624
oss_iops << ")";
627-
oss_depth << ")";
628625
oss_bd << ")";
629-
oss_iosz << ")";
626+
630627
INFO("{}", oss_iops.str());
631-
INFO("{}", oss_depth.str());
632628
INFO("{}", oss_bd.str());
633-
INFO("{}", oss_iosz.str());
629+
INFO("device IO depth per writer: {:.2f}", ts.total_depth/d_ts_num_io);
630+
INFO("device bytes per write: {:.2f}", ts.total_bytes/d_ts_num_io);
634631
return seastar::now();
635632
});
636633
}

0 commit comments

Comments
 (0)