add rate info to generate index log (#33108)

This commit is contained in:
Jeff Washington (jwash) 2023-09-01 11:40:00 -07:00 committed by GitHub
parent a4ceea32d7
commit 255029f61a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 4 deletions

View File

@ -718,6 +718,7 @@ struct MultiThreadProgress<'a> {
report_delay_secs: u64,
first_caller: bool,
ultimate_count: u64,
start_time: Instant,
}
impl<'a> MultiThreadProgress<'a> {
@ -729,6 +730,7 @@ impl<'a> MultiThreadProgress<'a> {
report_delay_secs,
first_caller: false,
ultimate_count,
start_time: Instant::now(),
}
}
fn report(&mut self, my_current_count: u64) {
@ -745,11 +747,13 @@ impl<'a> MultiThreadProgress<'a> {
self.first_caller =
self.first_caller || 0 == previous_total_processed_slots_across_all_threads;
if self.first_caller {
let total = previous_total_processed_slots_across_all_threads
+ my_total_newly_processed_slots_since_last_report;
info!(
"generating index: {}/{} slots...",
previous_total_processed_slots_across_all_threads
+ my_total_newly_processed_slots_since_last_report,
self.ultimate_count
"generating index: {}/{} slots... ({}/s)",
total,
self.ultimate_count,
total / self.start_time.elapsed().as_secs().max(1),
);
}
self.last_update = now;