Skip to content

Commit

Permalink
dump final startup index stats only after startup is complete (solana…
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffwashington authored Sep 25, 2023
1 parent 57e78a1 commit 18231e9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion accounts-db/src/bucket_map_holder_stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ impl BucketMapHolderStats {
// sum of elapsed time in each thread
let mut thread_time_elapsed_ms = elapsed_ms * storage.threads as u64;
if disk.is_some() {
if startup || was_startup {
if was_startup {
// these stats only apply at startup
datapoint_info!(
"accounts_index_startup",
Expand Down
7 changes: 3 additions & 4 deletions bucket_map/src/bucket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,16 +369,15 @@ impl<'b, T: Clone + Copy + PartialEq + std::fmt::Debug + 'static> Bucket<T> {
items.len().saturating_sub(duplicates.len()) as u64,
Ordering::Relaxed,
);
self.index.stats.startup.entries_reused.fetch_add(
let stats = &self.index.stats.startup;
stats.entries_reused.fetch_add(
items
.len()
.saturating_sub(duplicates.len())
.saturating_sub(entries_created_on_disk) as u64,
Ordering::Relaxed,
);
self.index
.stats
.startup
stats
.entries_created
.fetch_add(entries_created_on_disk as u64, Ordering::Relaxed);
return duplicates;
Expand Down

0 comments on commit 18231e9

Please sign in to comment.