mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 23:51:05 +00:00
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:
@@ -206,13 +206,16 @@ pub trait Backend<H: Hasher>: std::fmt::Debug {
|
||||
(root, txs)
|
||||
}
|
||||
|
||||
/// Register stats from overlay of state machine.
|
||||
///
|
||||
/// By default nothing is registered.
|
||||
fn register_overlay_stats(&mut self, _stats: &crate::stats::StateMachineStats);
|
||||
|
||||
/// Query backend usage statistics (i/o, memory)
|
||||
///
|
||||
/// Not all implementations are expected to be able to do this. In the
|
||||
/// case when they don't, empty statistics is returned.
|
||||
fn usage_info(&self) -> UsageInfo {
|
||||
UsageInfo::empty()
|
||||
}
|
||||
fn usage_info(&self) -> UsageInfo;
|
||||
|
||||
/// Wipe the state database.
|
||||
fn wipe(&self) -> Result<(), Self::Error> {
|
||||
@@ -308,10 +311,12 @@ impl<'a, T: Backend<H>, H: Hasher> Backend<H> for &'a T {
|
||||
(*self).for_key_values_with_prefix(prefix, f);
|
||||
}
|
||||
|
||||
fn register_overlay_stats(&mut self, _stats: &crate::stats::StateMachineStats) { }
|
||||
|
||||
fn usage_info(&self) -> UsageInfo {
|
||||
(*self).usage_info()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Trait that allows consolidate two transactions together.
|
||||
pub trait Consolidate {
|
||||
|
||||
Reference in New Issue
Block a user