From 3b1829f0d83c7f12d2ab82e0b9df43e1422bf11d Mon Sep 17 00:00:00 2001 From: "Raphael S. Carvalho" Date: Sat, 1 Jul 2023 05:01:52 -0300 Subject: [PATCH] compaction: base compaction throughput on amount of data read Today, we base compaction throughput on the amount of data written, but it should be based on the amount of input data compacted instead, to show the amount of data compaction had to process during its execution. A good example is a compaction which expire 99% of data, and today throughput would be calculated on the 1% written, which will mislead the reader to think that compaction was terribly slow. Fixes #14533. Signed-off-by: Raphael S. Carvalho Closes #14615 --- compaction/compaction.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compaction/compaction.cc b/compaction/compaction.cc index ab8fd9df8451..fce3fe1e5dc6 100644 --- a/compaction/compaction.cc +++ b/compaction/compaction.cc @@ -788,7 +788,7 @@ class compaction { log_info("{} {} sstables to {}. {} to {} (~{}% of original) in {}ms = {}. ~{} total partitions merged to {}.", report_finish_desc(), _input_sstable_generations.size(), new_sstables_msg, utils::pretty_printed_data_size(_start_size), utils::pretty_printed_data_size(_end_size), int(ratio * 100), - std::chrono::duration_cast(duration).count(), utils::pretty_printed_throughput(_end_size, duration), + std::chrono::duration_cast(duration).count(), utils::pretty_printed_throughput(_start_size, duration), _cdata.total_partitions, _cdata.total_keys_written); return ret;