restore population of 'accounts' metric in rent collection (#26454)

This commit is contained in:
Jeff Washington (jwash) 2022-07-07 13:19:23 -05:00 committed by GitHub
parent 72256ac54d
commit 8e64b5883e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -208,7 +208,7 @@ struct RentMetrics {
collect_us: AtomicU64,
hash_us: AtomicU64,
store_us: AtomicU64,
count: AtomicU64,
count: AtomicUsize,
}
#[derive(Clone, Debug, PartialEq, Eq)]
@ -5377,6 +5377,7 @@ impl Bank {
time_collecting_rent_us,
time_hashing_skipped_rewrites_us,
time_storing_accounts_us,
num_accounts: accounts.len(),
}
}
@ -5482,6 +5483,7 @@ impl Bank {
metrics
.store_us
.fetch_add(results.time_storing_accounts_us, Relaxed);
metrics.count.fetch_add(results.num_accounts, Relaxed);
});
}
@ -7619,6 +7621,7 @@ struct CollectRentFromAccountsInfo {
time_collecting_rent_us: u64,
time_hashing_skipped_rewrites_us: u64,
time_storing_accounts_us: u64,
num_accounts: usize,
}
/// Return the computed values—of each iteration in the parallel loop inside
@ -7633,6 +7636,7 @@ struct CollectRentInPartitionInfo {
time_collecting_rent_us: u64,
time_hashing_skipped_rewrites_us: u64,
time_storing_accounts_us: u64,
num_accounts: usize,
}
impl CollectRentInPartitionInfo {
@ -7649,6 +7653,7 @@ impl CollectRentInPartitionInfo {
time_collecting_rent_us: info.time_collecting_rent_us,
time_hashing_skipped_rewrites_us: info.time_hashing_skipped_rewrites_us,
time_storing_accounts_us: info.time_storing_accounts_us,
num_accounts: info.num_accounts,
}
}
@ -7677,6 +7682,7 @@ impl CollectRentInPartitionInfo {
time_storing_accounts_us: lhs
.time_storing_accounts_us
.saturating_add(rhs.time_storing_accounts_us),
num_accounts: lhs.num_accounts.saturating_add(rhs.num_accounts),
}
}
}