Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Add some missing points where to collect state stats #4660

Merged
merged 1 commit into from
Jan 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions client/db/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1149,6 +1149,7 @@ impl<Block: BlockT> Backend<Block> {
changes_trie_config_update,
changes_trie_cache_ops,
)?);
self.state_usage.merge_sm(operation.old_state.usage_info());
let cache = operation.old_state.release(); // release state reference so that it can be finalized

if finalized {
Expand Down Expand Up @@ -1619,6 +1620,7 @@ impl<Block: BlockT> sc_client_api::backend::Backend<Block> for Backend<Block> {
}

fn destroy_state(&self, state: Self::State) -> ClientResult<()> {
self.state_usage.merge_sm(state.usage_info());
if let Some(hash) = state.cache.parent_hash.clone() {
let is_best = self.blockchain.meta.read().best_hash == hash;
state.release().sync_cache(&[], &[], vec![], vec![], None, None, is_best);
Expand Down