From ef92a062f603b042432e2b6f9fa21474763a4448 Mon Sep 17 00:00:00 2001 From: zwang28 <70626450+zwang28@users.noreply.github.com> Date: Tue, 24 Dec 2024 19:52:53 +0800 Subject: [PATCH] fix(metric): include table change log when calculating Hummock version size (#19920) --- src/storage/hummock_sdk/src/version.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/storage/hummock_sdk/src/version.rs b/src/storage/hummock_sdk/src/version.rs index 7f4b4dafb1bf7..f0bd4582752be 100644 --- a/src/storage/hummock_sdk/src/version.rs +++ b/src/storage/hummock_sdk/src/version.rs @@ -271,6 +271,21 @@ impl HummockVersion { .values() .map(|table_watermark| table_watermark.estimated_encode_len()) .sum::() + + self + .table_change_log + .values() + .map(|c| { + c.0.iter() + .map(|l| { + l.old_value + .iter() + .chain(l.new_value.iter()) + .map(|s| s.estimated_encode_len()) + .sum::() + }) + .sum::() + }) + .sum::() } }