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

Commit 50cd0dc

Browse files
committed
Log actual size during size pruning
1 parent 9a556f8 commit 50cd0dc

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ use bee_message::milestone::MilestoneIndex;
1010
use bee_runtime::event::Bus;
1111
use bee_storage::access::{Batch, Truncate};
1212
use bee_tangle::{solid_entry_point::SolidEntryPoint, Tangle};
13-
use log::{debug, info};
1413

1514
use crate::workers::{
1615
event::PrunedIndex,
@@ -48,7 +47,7 @@ pub async fn prune_by_range<S: StorageBackend>(
4847
}
4948

5049
if start_index != target_index {
51-
info!(
50+
log::info!(
5251
"Pruning from milestone {} to milestone {}...",
5352
start_index, target_index
5453
);
@@ -59,9 +58,9 @@ pub async fn prune_by_range<S: StorageBackend>(
5958
}
6059

6160
if start_index == target_index {
62-
info!("Pruned milestone {}.", start_index);
61+
log::info!("Pruned milestone {}.", start_index);
6362
} else {
64-
info!("Pruned from milestone {} to milestone {}.", start_index, target_index);
63+
log::info!("Pruned from milestone {} to milestone {}.", start_index, target_index);
6564
}
6665

6766
Ok(())
@@ -82,6 +81,7 @@ pub async fn prune_by_size<S: StorageBackend>(
8281
loop {
8382
// Panic: already checked that size() returns a valid result.
8483
let actual_size = storage.size().expect("ok storage size").expect("some storage size");
84+
log::debug!("Storage size: actual {actual_size} reduced {reduced_size}");
8585

8686
if actual_size > reduced_size {
8787
let index = *tangle.get_pruning_index() + 1;
@@ -106,7 +106,7 @@ async fn prune_milestone<S: StorageBackend>(
106106
) -> Result<(), PruningError> {
107107
let index = MilestoneIndex(index);
108108

109-
debug!("Pruning milestone {}...", index);
109+
log::debug!("Pruning milestone {}...", index);
110110

111111
// Measurement of the full pruning step.
112112
let full_prune = Instant::now();
@@ -224,15 +224,15 @@ async fn prune_milestone<S: StorageBackend>(
224224

225225
timings.full_prune = full_prune.elapsed();
226226

227-
debug!("{:?}.", metrics);
228-
debug!("{:?}", confirmed_data_metrics);
229-
debug!("{:?}", unconfirmed_data_metrics);
230-
debug!("{:?}.", timings);
231-
debug!(
227+
log::debug!("{:?}.", metrics);
228+
log::debug!("{:?}", confirmed_data_metrics);
229+
log::debug!("{:?}", unconfirmed_data_metrics);
230+
log::debug!("{:?}.", timings);
231+
log::debug!(
232232
"Entry point index now at {} with {} solid entry points..",
233233
index, num_next_seps
234234
);
235-
debug!("Pruned milestone {}.", index);
235+
log::debug!("Pruned milestone {}.", index);
236236

237237
bus.dispatch(PrunedIndex { index });
238238

0 commit comments

Comments
 (0)