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

Commit 255029f

Browse files
add rate info to generate index log (#33108)
1 parent a4ceea3 commit 255029f

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

accounts-db/src/accounts_db.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,7 @@ struct MultiThreadProgress<'a> {
718718
report_delay_secs: u64,
719719
first_caller: bool,
720720
ultimate_count: u64,
721+
start_time: Instant,
721722
}
722723

723724
impl<'a> MultiThreadProgress<'a> {
@@ -729,6 +730,7 @@ impl<'a> MultiThreadProgress<'a> {
729730
report_delay_secs,
730731
first_caller: false,
731732
ultimate_count,
733+
start_time: Instant::now(),
732734
}
733735
}
734736
fn report(&mut self, my_current_count: u64) {
@@ -745,11 +747,13 @@ impl<'a> MultiThreadProgress<'a> {
745747
self.first_caller =
746748
self.first_caller || 0 == previous_total_processed_slots_across_all_threads;
747749
if self.first_caller {
750+
let total = previous_total_processed_slots_across_all_threads
751+
+ my_total_newly_processed_slots_since_last_report;
748752
info!(
749-
"generating index: {}/{} slots...",
750-
previous_total_processed_slots_across_all_threads
751-
+ my_total_newly_processed_slots_since_last_report,
752-
self.ultimate_count
753+
"generating index: {}/{} slots... ({}/s)",
754+
total,
755+
self.ultimate_count,
756+
total / self.start_time.elapsed().as_secs().max(1),
753757
);
754758
}
755759
self.last_update = now;

0 commit comments

Comments
 (0)