Skip to content

Commit

Permalink
add calc_stored_meta_us metric (#17318)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffwashington authored May 19, 2021
1 parent f1b4a0a commit b5302e7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions runtime/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,7 @@ struct AccountsStats {

last_store_report: AtomicU64,
store_hash_accounts: AtomicU64,
calc_stored_meta: AtomicU64,
store_accounts: AtomicU64,
store_update_index: AtomicU64,
store_handle_reclaims: AtomicU64,
Expand Down Expand Up @@ -3811,6 +3812,7 @@ impl AccountsDb {
mut write_version_producer: P,
is_cached_store: bool,
) -> Vec<AccountInfo> {
let mut calc_stored_meta_time = Measure::start("calc_stored_meta");
let accounts_and_meta_to_store: Vec<_> = accounts
.iter()
.map(|(pubkey, account)| {
Expand All @@ -3831,6 +3833,10 @@ impl AccountsDb {
(meta, account)
})
.collect();
calc_stored_meta_time.stop();
self.stats
.calc_stored_meta
.fetch_add(calc_stored_meta_time.as_us(), Ordering::Relaxed);

if self.caching_enabled && is_cached_store {
self.write_accounts_to_cache(slot, hashes, &accounts_and_meta_to_store)
Expand Down Expand Up @@ -4754,6 +4760,11 @@ impl AccountsDb {
read_only_cache_misses,
i64
),
(
"calc_stored_meta_us",
self.stats.calc_stored_meta.swap(0, Ordering::Relaxed),
i64
),
);

let recycle_stores = self.recycle_stores.read().unwrap();
Expand Down

0 comments on commit b5302e7

Please sign in to comment.