log roots range metric (#16636)

* log roots range metric

* rename
This commit is contained in:
Jeff Washington (jwash)
2021-04-23 11:09:39 -05:00
committed by GitHub
parent 2c82f2154d
commit 1cc9a1c0eb
2 changed files with 43 additions and 7 deletions

View File

@@ -950,6 +950,7 @@ struct LatestAccountsIndexRootsStats {
roots_len: AtomicUsize,
uncleaned_roots_len: AtomicUsize,
previous_uncleaned_roots_len: AtomicUsize,
roots_range: AtomicU64,
}
impl LatestAccountsIndexRootsStats {
@@ -964,6 +965,8 @@ impl LatestAccountsIndexRootsStats {
accounts_index_roots_stats.previous_uncleaned_roots_len,
Ordering::Relaxed,
);
self.roots_range
.store(accounts_index_roots_stats.roots_range, Ordering::Relaxed);
}
fn report(&self) {
@@ -984,6 +987,11 @@ impl LatestAccountsIndexRootsStats {
self.previous_uncleaned_roots_len.load(Ordering::Relaxed) as i64,
i64
),
(
"roots_range_width",
self.roots_range.load(Ordering::Relaxed) as i64,
i64
),
);
// Don't need to reset since this tracks the latest updates, not a cumulative total