mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 17:01:09 +00:00
Configurable state cache size and enforce exact state cache size (#2314)
* Allow configuring state cache size via cli * Track used cache size * Expose memory counter to informant * Enforce max cache size constraint exactly * Default to 64 MiB Co-Authored-By: cmichi <mich@elmueller.net> * Remove self as parameter
This commit is contained in:
committed by
Gavin Wood
parent
3f06fe32f3
commit
c6d15e2cea
@@ -76,6 +76,12 @@ pub fn start<C>(service: &Service<C>, exit: ::exit_future::Exit, handle: TaskExe
|
||||
TransferRateFormat(bandwidth_upload),
|
||||
);
|
||||
|
||||
let backend = (*client).backend();
|
||||
let used_state_cache_size = match backend.used_state_cache_size(){
|
||||
Some(size) => size,
|
||||
None => 0,
|
||||
};
|
||||
|
||||
// get cpu usage and memory usage of this process
|
||||
let (cpu_usage, memory) = if sys.refresh_process(self_pid) {
|
||||
let proc = sys.get_process(self_pid).expect("Above refresh_process succeeds, this should be Some(), qed");
|
||||
@@ -99,6 +105,7 @@ pub fn start<C>(service: &Service<C>, exit: ::exit_future::Exit, handle: TaskExe
|
||||
"finalized_hash" => ?info.chain.finalized_hash,
|
||||
"bandwidth_download" => bandwidth_download,
|
||||
"bandwidth_upload" => bandwidth_upload,
|
||||
"used_state_cache_size" => used_state_cache_size,
|
||||
);
|
||||
} else {
|
||||
warn!("Error getting best block information");
|
||||
|
||||
Reference in New Issue
Block a user