AcctIdx: stats are usize (#21493)

* AcctIdx: stats are usize

* rename test function
This commit is contained in:
Jeff Washington (jwash)
2021-11-30 11:35:21 -06:00
committed by GitHub
parent 38fcfb7542
commit 7ec88226ee
4 changed files with 38 additions and 34 deletions

View File

@@ -463,12 +463,8 @@ impl<T: IndexValue> InMemAccountsIndex<T> {
))
}
pub fn len(&self) -> usize {
self.map().read().unwrap().len()
}
pub fn is_empty(&self) -> bool {
self.len() == 0
pub fn len_for_stats(&self) -> usize {
self.stats().count_in_bucket(self.bin)
}
fn insert_returner(
@@ -880,12 +876,12 @@ impl<T: IndexValue> InMemAccountsIndex<T> {
}
self.stats()
.insert_or_delete_mem_count(false, self.bin, removed);
Self::update_stat(&self.stats().flush_entries_removed_from_mem, removed);
Self::update_stat(&self.stats().flush_entries_removed_from_mem, removed as u64);
completed_scan
}
fn stats(&self) -> &BucketMapHolderStats {
pub fn stats(&self) -> &BucketMapHolderStats {
&self.storage.stats
}