Skip to content

Commit

Permalink
delete obsolete code
Browse files Browse the repository at this point in the history
update for enable_execution_duration_record
  • Loading branch information
anonymousGiga committed Nov 8, 2023
1 parent 3da2506 commit d433f3c
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 374 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions bin/reth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ boyer-moore-magiclen = "0.2.16"

minstant = { version = "0.1.3", optional = true }

parking_lot = { version = "0.12", optional = true }

[target.'cfg(not(windows))'.dependencies]
jemallocator = { version = "0.5.0", optional = true }
Expand All @@ -142,8 +141,6 @@ min-debug-logs = ["tracing/release_max_level_debug"]
min-trace-logs = ["tracing/release_max_level_trace"]
open_performance_dashboard = [
"reth-stages/open_performance_dashboard",
"minstant",
"parking_lot",
]
enable_opcode_metrics = [
"reth-revm/enable_opcode_metrics",
Expand All @@ -166,6 +163,7 @@ enable_cache_record = [
enable_tps_gas_record = [
"reth-stages/enable_tps_gas_record",
"open_performance_dashboard",
"minstant",
]
finish_after_execution_stage = ["reth-stages/finish_after_execution_stage"]
enable_execution_duration_record = [
Expand Down
25 changes: 0 additions & 25 deletions bin/reth/src/node/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ use tracing::*;

#[cfg(feature = "open_performance_dashboard")]
use crate::performance_metrics::DashboardListener;
// use crate::performance_metrics::{DashboardEventsSender, DashboardListener};

pub mod cl_events;
pub mod events;
Expand Down Expand Up @@ -251,11 +250,6 @@ impl<Ext: RethCliExt> NodeCommand<Ext> {

self.start_metrics_endpoint(Arc::clone(&db)).await?;

#[cfg(feature = "open_performance_dashboard")]
{
start_performance_dashboard(&ctx.task_executor);
}

debug!(target: "reth::cli", chain=%self.chain.chain, genesis=?self.chain.genesis_hash(), "Initializing genesis");

let genesis_hash = init_genesis(db.clone(), self.chain.clone())?;
Expand Down Expand Up @@ -947,25 +941,6 @@ async fn run_network_until_shutdown<C>(
}
}

#[cfg(feature = "open_performance_dashboard")]
fn start_performance_dashboard(task_executor: &TaskExecutor) {
use crate::performance_metrics::{metric_handler::*, metric_recoder::*, metric_storage::*};

let storage = Arc::new(PerformanceDashboardMetricStorage::default());

let recorder = PerformanceDashboardRecorder::new(storage.clone());
metrics::set_boxed_recorder(Box::new(recorder)).unwrap();

let mut performance_dashboard_handler = PerformanceDashboardMetricHandler::new(storage);

task_executor.spawn_critical(
"performance dashboard",
Box::pin(async move {
performance_dashboard_handler.run(300).await;
}),
);
}

#[cfg(test)]
mod tests {
use super::*;
Expand Down
9 changes: 5 additions & 4 deletions bin/reth/src/performance_metrics/dashboard_display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl OpcodeStats {
// println!("Total Count : {:>20}", self.total_count);
// println!("Total Time (s) : {:>20.2}", self.total_duration.as_secs_f64());
// println!(
// "Ave Cost (ns) : {:>20.1}",
// "Avg Cost (ns) : {:>20.1}",
// self.total_duration.as_nanos() as f64 / self.total_count as f64
// );
println!("");
Expand Down Expand Up @@ -326,8 +326,9 @@ impl ExecutionDurationDisplayer {
pub(crate) fn print(&self) {
self.excution_duration_record.print("===============================Metric of execution duration==========================================================");

let pure_record = self.excution_duration_record.pure_record();
pure_record.print("===============================Metric of pure execution duration==========================================================");
// let pure_record = self.excution_duration_record.pure_record();
// pure_record.print("===============================Metric of pure execution
// duration==========================================================");
}
}

Expand Down Expand Up @@ -378,7 +379,7 @@ impl CacheDBRecordDisplayer {
let col_percentage_len = 20;

println!(
"{:col_funciotns_len$}{:col_times_len$}{:col_percentage_len$.3}",
"{:col_funciotns_len$}{:>col_times_len$}{:>col_percentage_len$.3}",
function, times, percentiles
);
}
Expand Down
2 changes: 0 additions & 2 deletions bin/reth/src/performance_metrics/dashboard_listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ use reth_stages::MetricEvent;

#[cfg(feature = "enable_opcode_metrics")]
use super::dashboard_display::RevmMetricTimeDisplayer;
// #[cfg(feature = "enable_opcode_metrics")]
// use revm_utils::types::RevmMetricRecord;

#[cfg(feature = "enable_execution_duration_record")]
use super::dashboard_display::ExecutionDurationDisplayer;
Expand Down
1 change: 0 additions & 1 deletion bin/reth/src/performance_metrics/dashboard_opcode.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use revm_interpreter::opcode::*;
// use std::collections::HashMap;

pub(crate) const OPCODE_NUMBER: usize = std::u8::MAX as usize + 1;

Expand Down
80 changes: 0 additions & 80 deletions bin/reth/src/performance_metrics/metric_handler.rs

This file was deleted.

122 changes: 0 additions & 122 deletions bin/reth/src/performance_metrics/metric_recoder.rs

This file was deleted.

Loading

0 comments on commit d433f3c

Please sign in to comment.