diff --git a/pageserver/ctl/src/layers.rs b/pageserver/ctl/src/layers.rs index 39e0d36eaa3ff..6d2935d3ac39e 100644 --- a/pageserver/ctl/src/layers.rs +++ b/pageserver/ctl/src/layers.rs @@ -306,7 +306,7 @@ pub(crate) async fn main(cmd: &LayerCmd) -> Result<()> { let semaphore = Arc::new(Semaphore::new(parallelism.unwrap_or(1) as usize)); let mut tasks = JoinSet::new(); - for file_key in files_list.keys.iter() { + for (file_idx, file_key) in files_list.keys.iter().enumerate() { let Some(file_name) = file_key.object_name() else { continue; }; @@ -360,6 +360,7 @@ pub(crate) async fn main(cmd: &LayerCmd) -> Result<()> { let storage = storage.clone(); let tmp_dir = tmp_dir.to_owned(); let file_name = file_name.to_owned(); + let percent = files_list.keys.len() * 100 / file_idx; tasks.spawn(async move { let stats = stats( semaphore, @@ -371,7 +372,9 @@ pub(crate) async fn main(cmd: &LayerCmd) -> Result<()> { ) .await; match stats { - Ok(stats) => println!("Statistics for {file_name}: {stats:?}\n"), + Ok(stats) => { + println!("Statistics for {file_name} ({percent}%): {stats:?}\n") + } Err(e) => eprintln!("Error for {file_name}: {e:?}"), }; });