State metrics possible changes (#5168)

* Registering state from overlay.

* fix

* fix2

* Apply suggestions from code review

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
cheme
2020-04-01 19:46:40 +02:00
committed by GitHub
parent a8aedfa16f
commit 58578af074
17 changed files with 232 additions and 33 deletions
+7 -3
View File
@@ -179,8 +179,12 @@ pub struct IoInfo {
pub state_reads: u64,
/// State reads (keys) from cache.
pub state_reads_cache: u64,
/// State reads (keys) from cache.
/// State reads (keys)
pub state_writes: u64,
/// State write (keys) already cached.
pub state_writes_cache: u64,
/// State write (trie nodes) to backend db.
pub state_writes_nodes: u64,
}
/// Usage statistics for running client instance.
@@ -202,7 +206,7 @@ impl fmt::Display for UsageInfo {
f,
"caches: ({} state, {} db overlay), \
state db: ({} non-canonical, {} pruning, {} pinned), \
i/o: ({} tx, {} write, {} read, {} avg tx, {}/{} key cache reads/total, {} key writes)",
i/o: ({} tx, {} write, {} read, {} avg tx, {}/{} key cache reads/total, {} trie nodes writes)",
self.memory.state_cache,
self.memory.database_cache,
self.memory.state_db.non_canonical,
@@ -214,7 +218,7 @@ impl fmt::Display for UsageInfo {
self.io.average_transaction_size,
self.io.state_reads_cache,
self.io.state_reads,
self.io.state_writes,
self.io.state_writes_nodes,
)
}
}