Skip to content

Commit 88fa106

Browse files
committed
storage: remove compaction_ratio metric from probe
The cardinality of this metric is much too high, and its usefulness does not justify the cost. Aggregating it would also reduce its usefulness. We have plenty of log lines from which one could infer the "compactibility" of a `segment`/`log`/`topic`.
1 parent 0d4187b commit 88fa106

3 files changed

Lines changed: 0 additions & 16 deletions

File tree

src/v/storage/disk_log_impl.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1413,8 +1413,6 @@ ss::future<> disk_log_impl::housekeeping(housekeeping_config cfg) {
14131413
std::rethrow_exception(fut.get_exception());
14141414
}
14151415
}
1416-
1417-
_probe->set_compaction_ratio(_compaction_ratio.get());
14181416
}
14191417

14201418
ss::future<> disk_log_impl::do_compact(

src/v/storage/probe.cc

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -258,18 +258,6 @@ void probe::setup_metrics(const model::ntp& ntp) {
258258
},
259259
{},
260260
{sm::shard_label, metrics::partition_label});
261-
262-
_metrics.add_group(
263-
group_name,
264-
{
265-
// compaction_ratio cannot easily be aggregated since aggregation always
266-
// sums values and sum is nonsensical for a compaction ratio
267-
sm::make_total_bytes(
268-
"compaction_ratio",
269-
[this] { return _compaction_ratio; },
270-
sm::description("Average segment compaction ratio"),
271-
labels),
272-
});
273261
}
274262

275263
void probe::add_initial_segment(const segment& s) {

src/v/storage/probe.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ class probe {
125125
size_t partition_size() const { return _partition_bytes; }
126126
void add_initial_segment(const segment&);
127127
void remove_partition_bytes(size_t remove) { _partition_bytes -= remove; }
128-
void set_compaction_ratio(double r) { _compaction_ratio = r; }
129128

130129
int64_t get_batch_parse_errors() const { return _batch_parse_errors; }
131130
/**
@@ -164,7 +163,6 @@ class probe {
164163
uint32_t _batch_parse_errors = 0;
165164
uint32_t _batch_write_errors = 0;
166165

167-
double _compaction_ratio = 1.0;
168166
uint64_t _tombstones_removed = 0;
169167
uint64_t _control_batches_removed = 0;
170168
uint64_t _segment_cleanly_compacted = 0;

0 commit comments

Comments
 (0)