Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 4c689ff

Browse files
committed
Debug log actual and target storage size
1 parent 784709f commit 4c689ff

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

bee-ledger/src/workers/pruning/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const PRUNING_BY_SIZE_ENABLED_DEFAULT: bool = true;
1414
const MAX_MILESTONES_TO_KEEP_DEFAULT: u32 = 60480;
1515
const THRESHOLD_PERCENTAGE_DEFAULT: f32 = 10.0;
1616
const COOLDOWN_TIME_DEFAULT: &str = "5m";
17-
const TARGET_SIZE_DEFAULT: &str = "30Gb";
17+
const TARGET_SIZE_DEFAULT: &str = "30Gb";
1818

1919
/// Builder for a [`PruningConfig`].
2020
#[derive(Default, Deserialize, PartialEq)]

bee-ledger/src/workers/pruning/prune.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ pub async fn prune<S: StorageBackend>(
5858
let index = MilestoneIndex(index);
5959

6060
debug!("Pruning milestone {}...", index);
61-
62-
//
61+
debug!("Storage size: actual {} limit {}", storage.size().expect("ok storage size").expect("some storage size"), config.pruning_by_size().target_size());
6362

6463
// Measurement of the full pruning step.
6564
let full_prune = Instant::now();

bee-storage/bee-storage-rocksdb/src/storage.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,7 @@ impl StorageBackend for Storage {
212212
}
213213

214214
fn size(&self) -> Result<Option<usize>, Self::Error> {
215-
Ok(Some(
216-
self.inner.live_files()?.iter().fold(0, |acc, file| acc + file.size),
217-
))
215+
Ok(Some(self.inner.live_files()?.iter().map(|file| file.size).sum()))
218216
}
219217

220218
fn get_health(&self) -> Result<Option<StorageHealth>, Self::Error> {

0 commit comments

Comments
 (0)