dump final startup index stats only after startup is complete (#33400)

This commit is contained in:
Jeff Washington (jwash) 2023-09-25 12:19:52 -07:00 committed by GitHub
parent 57e78a16dc
commit 18231e9a5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 5 deletions

View File

@ -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",

View File

@ -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;