Clean up database metrics, add freezer DB size (#715)

* Clean up database metrics, add freezer DB size

* Address review comments
This commit is contained in:
Michael Sproul
2019-12-13 13:30:58 +11:00
committed by Paul Hauner
parent b9d00ee8b8
commit 5e7803f00b
7 changed files with 57 additions and 25 deletions

View File

@@ -1209,14 +1209,14 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
});
}
if self.store.exists::<BeaconBlock<T::EthSpec>>(&block_root)? {
return Ok(BlockProcessingOutcome::BlockIsAlreadyKnown);
}
// Records the time taken to load the block and state from the database during block
// processing.
let db_read_timer = metrics::start_timer(&metrics::BLOCK_PROCESSING_DB_READ);
if self.store.exists::<BeaconBlock<T::EthSpec>>(&block_root)? {
return Ok(BlockProcessingOutcome::BlockIsAlreadyKnown);
}
// Load the blocks parent block from the database, returning invalid if that block is not
// found.
let parent_block: BeaconBlock<T::EthSpec> =