diff --git a/Cargo.lock b/Cargo.lock index d3e5efcd6094..617fb402fb73 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6229,7 +6229,7 @@ dependencies = [ [[package]] name = "revm" version = "3.3.0" -source = "git+https://github.com/megaeth-labs/revm?branch=andy/debug/performance-dashboard#d6af4df40fcaa9eb4721ddf980cb3da373b3200d" +source = "git+https://github.com/megaeth-labs/revm?branch=andy/debug/performance-dashboard#d1ae2facd5aad8e3c5489fbddaf8299e0bc70a29" dependencies = [ "auto_impl", "revm-interpreter", @@ -6241,7 +6241,7 @@ dependencies = [ [[package]] name = "revm-interpreter" version = "1.1.2" -source = "git+https://github.com/megaeth-labs/revm?branch=andy/debug/performance-dashboard#d6af4df40fcaa9eb4721ddf980cb3da373b3200d" +source = "git+https://github.com/megaeth-labs/revm?branch=andy/debug/performance-dashboard#d1ae2facd5aad8e3c5489fbddaf8299e0bc70a29" dependencies = [ "derive_more", "enumn", @@ -6253,7 +6253,7 @@ dependencies = [ [[package]] name = "revm-precompile" version = "2.0.3" -source = "git+https://github.com/megaeth-labs/revm?branch=andy/debug/performance-dashboard#d6af4df40fcaa9eb4721ddf980cb3da373b3200d" +source = "git+https://github.com/megaeth-labs/revm?branch=andy/debug/performance-dashboard#d1ae2facd5aad8e3c5489fbddaf8299e0bc70a29" dependencies = [ "k256", "num", @@ -6269,7 +6269,7 @@ dependencies = [ [[package]] name = "revm-primitives" version = "1.1.2" -source = "git+https://github.com/megaeth-labs/revm?branch=andy/debug/performance-dashboard#d6af4df40fcaa9eb4721ddf980cb3da373b3200d" +source = "git+https://github.com/megaeth-labs/revm?branch=andy/debug/performance-dashboard#d1ae2facd5aad8e3c5489fbddaf8299e0bc70a29" dependencies = [ "arbitrary", "auto_impl", @@ -6293,7 +6293,7 @@ dependencies = [ [[package]] name = "revm-utils" version = "0.1.0" -source = "git+https://github.com/megaeth-labs/revm?branch=andy/debug/performance-dashboard#d6af4df40fcaa9eb4721ddf980cb3da373b3200d" +source = "git+https://github.com/megaeth-labs/revm?branch=andy/debug/performance-dashboard#d1ae2facd5aad8e3c5489fbddaf8299e0bc70a29" dependencies = [ "ctor 0.2.5", "serde", diff --git a/bin/reth/src/performance_metrics/dashboard_display.rs b/bin/reth/src/performance_metrics/dashboard_display.rs index c12619a65def..975c3c53792c 100644 --- a/bin/reth/src/performance_metrics/dashboard_display.rs +++ b/bin/reth/src/performance_metrics/dashboard_display.rs @@ -469,11 +469,12 @@ impl CacheDBRecordDisplayer { } println!(); println!(); - let total_ns_count = self.cache_db_record.penalty.us_percentile[0]; - println!("========================================Penalty percentile ==============================================="); + println!("========================================Penalty percentile(0-4us) ==============================================="); println! {"{: COL_WIDTH_MIDDLE$}", "time (ns)", "Count (%)"}; for (i, v) in self.cache_db_record.penalty.ns_percentile.iter().enumerate() { - println! {"{: COL_WIDTH_MIDDLE$.6}", i+1, (*v * 100) as f64 / total_ns_count as f64}; + println! {"{: COL_WIDTH_MIDDLE$.6}", i+1, + (*v * 100) as f64 / total_us_count as f64, + }; } } } diff --git a/crates/stages/src/metrics/util.rs b/crates/stages/src/metrics/util.rs index 22fe7f882a13..d34f7cfee564 100644 --- a/crates/stages/src/metrics/util.rs +++ b/crates/stages/src/metrics/util.rs @@ -83,11 +83,16 @@ impl ExecutionDurationRecord { } /// add pub fn add(&mut self, other: ExecutionDurationRecord) { - self.execute_inner_time = self.execute_inner_time.checked_add(other.execute_inner_time).expect("overflow"); - self.fetching_block_time = self.fetching_block_time.checked_add(other.fetching_block_time).expect("overflow"); - self.execution_time = self.execution_time.checked_add(other.execution_time).expect("overflow"); - self.process_state_time = self.process_state_time.checked_add(other.process_state_time).expect("overflow"); - self.write_to_db_time = self.write_to_db_time.checked_add(other.write_to_db_time).expect("overflow"); + self.execute_inner_time = + self.execute_inner_time.checked_add(other.execute_inner_time).expect("overflow"); + self.fetching_block_time = + self.fetching_block_time.checked_add(other.fetching_block_time).expect("overflow"); + self.execution_time = + self.execution_time.checked_add(other.execution_time).expect("overflow"); + self.process_state_time = + self.process_state_time.checked_add(other.process_state_time).expect("overflow"); + self.write_to_db_time = + self.write_to_db_time.checked_add(other.write_to_db_time).expect("overflow"); } fn execute_inner_time(&self) -> f64 { diff --git a/crates/storage/libmdbx-rs/src/metric.rs b/crates/storage/libmdbx-rs/src/metric.rs index 8b762d7a541e..2158bbb19cd8 100644 --- a/crates/storage/libmdbx-rs/src/metric.rs +++ b/crates/storage/libmdbx-rs/src/metric.rs @@ -60,9 +60,7 @@ pub fn add_db_write_record(size: usize, time: Duration) { /// get db record pub fn get_db_record() -> (usize, Duration, usize, Duration) { - unsafe { - METRIC_RECORD.get_record() - } + unsafe { METRIC_RECORD.get_record() } } pub struct WriteRecord {