informant: display I/O stats (#11523)

* informant: collect I/O stats for state_db

* informat: debug i/o log

* informat: remove unused cache hit ratio

* Cargo.lock: cargo update -p librocksdb-sys

* [deps]: upgrade kvdb-rocksdb to 0.6

* Update ethcore/types/src/client_types.rs

Co-Authored-By: David <dvdplm@gmail.com>

Co-authored-by: David <dvdplm@gmail.com>
This commit is contained in:
Andronik Ordian
2020-03-17 16:44:27 +01:00
committed by GitHub
parent 3231454bb1
commit 70c4ed7fa0
16 changed files with 144 additions and 36 deletions

View File

@@ -102,6 +102,10 @@ impl JournalDB for ArchiveDB {
Box::new(self.clone())
}
fn io_stats(&self) -> kvdb::IoStats {
self.backing.io_stats(kvdb::IoStatsKind::SincePrevious)
}
fn mem_used(&self) -> usize {
self.overlay.malloc_size_of()
}

View File

@@ -322,6 +322,10 @@ impl JournalDB for EarlyMergeDB {
Box::new(self.clone())
}
fn io_stats(&self) -> kvdb::IoStats {
self.backing.io_stats(kvdb::IoStatsKind::SincePrevious)
}
fn is_empty(&self) -> bool {
self.backing.get(self.column, &LATEST_ERA_KEY).expect("Low level database error").is_none()
}

View File

@@ -45,6 +45,9 @@ pub trait JournalDB: HashDB<KeccakHasher, DBValue> {
/// Returns heap memory size used
fn mem_used(&self) -> usize;
/// Returns the I/O statistics.
fn io_stats(&self) -> kvdb::IoStats;
/// Returns the size of journalled state in memory.
/// This function has a considerable speed requirement --
/// it must be fast enough to call several times per block imported.

View File

@@ -244,6 +244,10 @@ impl JournalDB for OverlayRecentDB {
Box::new(self.clone())
}
fn io_stats(&self) -> kvdb::IoStats {
self.backing.io_stats(kvdb::IoStatsKind::SincePrevious)
}
fn mem_used(&self) -> usize {
let mut ops = new_malloc_size_ops();
let mut mem = self.transaction_overlay.size_of(&mut ops);

View File

@@ -98,6 +98,10 @@ impl JournalDB for RefCountedDB {
Box::new(self.clone())
}
fn io_stats(&self) -> kvdb::IoStats {
self.backing.io_stats(kvdb::IoStatsKind::SincePrevious)
}
fn mem_used(&self) -> usize {
let mut ops = new_malloc_size_ops();
self.inserts.size_of(&mut ops) + self.removes.size_of(&mut ops)

View File

@@ -8,7 +8,7 @@ license = "GPL-3.0"
[dependencies]
log = "0.4"
kvdb = "0.4.0"
kvdb-rocksdb = "0.5.0"
kvdb-rocksdb = "0.6.0"
[dev-dependencies]
tempdir = "0.3"