Expose state-db memory info (#5110)

This exposes memory statistics from the state-db.
This commit is contained in:
Bastian Köcher
2020-03-03 10:24:26 +01:00
committed by GitHub
parent d3244b728a
commit 4f852d6922
10 changed files with 196 additions and 42 deletions
+2 -1
View File
@@ -31,6 +31,7 @@ const LAST_PRUNED: &[u8] = b"last_pruned";
const PRUNING_JOURNAL: &[u8] = b"pruning_journal";
/// See module documentation.
#[derive(parity_util_mem_derive::MallocSizeOf)]
pub struct RefWindow<BlockHash: Hash, Key: Hash> {
/// A queue of keys that should be deleted for each block in the pruning window.
death_rows: VecDeque<DeathRow<BlockHash, Key>>,
@@ -46,7 +47,7 @@ pub struct RefWindow<BlockHash: Hash, Key: Hash> {
pending_prunings: usize,
}
#[derive(Debug, PartialEq, Eq)]
#[derive(Debug, PartialEq, Eq, parity_util_mem_derive::MallocSizeOf)]
struct DeathRow<BlockHash: Hash, Key: Hash> {
hash: BlockHash,
journal_key: Vec<u8>,