Skip to content

Commit

Permalink
fix(metric): include table change log when calculating Hummock versio…
Browse files Browse the repository at this point in the history
…n size (#19920)
  • Loading branch information
zwang28 authored Dec 24, 2024
1 parent 81f651f commit 86c3933
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/storage/hummock_sdk/src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,21 @@ impl HummockVersion {
.values()
.map(|table_watermark| table_watermark.estimated_encode_len())
.sum::<usize>()
+ 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::<usize>()
})
.sum::<usize>()
})
.sum::<usize>()
}
}

Expand Down

0 comments on commit 86c3933

Please sign in to comment.