diff --git a/src/meta/src/hummock/metrics_utils.rs b/src/meta/src/hummock/metrics_utils.rs index 8bcc1f1d2c1c6..9917d559a0709 100644 --- a/src/meta/src/hummock/metrics_utils.rs +++ b/src/meta/src/hummock/metrics_utils.rs @@ -483,15 +483,15 @@ pub fn trigger_split_stat( .with_label_values(&[&group_label]) .set(member_table_id_len as _); - let branched_sst_count = branched_ssts + let branched_sst_count: usize = branched_ssts .values() - .map(|branched_map| branched_map.iter()) - .flat_map(|branched_map| { + .map(|branched_map| { branched_map - .filter(|(group_id, _sst_id)| **group_id == compaction_group_id) - .map(|(_, v)| v) + .keys() + .filter(|group_id| **group_id == compaction_group_id) + .count() }) - .sum::(); + .sum(); metrics .branched_sst_count