From e5a41173815b0119db34ddddd58f86da94749ea1 Mon Sep 17 00:00:00 2001 From: leopardracer <136604165+leopardracer@users.noreply.github.com> Date: Wed, 5 Feb 2025 12:34:54 +0200 Subject: [PATCH 1/2] Update opcode.rs --- perf-metrics/src/dashboard/opcode.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/perf-metrics/src/dashboard/opcode.rs b/perf-metrics/src/dashboard/opcode.rs index bfa7c49..76aaf16 100644 --- a/perf-metrics/src/dashboard/opcode.rs +++ b/perf-metrics/src/dashboard/opcode.rs @@ -1380,7 +1380,7 @@ impl OpcodeStat { } // Return (total_gas, static_gas, dyn_gas). -fn caculate_gas(opcode: u8, count: u64, total_gas: i128) -> (f64, u64, f64) { +fn calculate_gas(opcode: u8, count: u64, total_gas: i128) -> (f64, u64, f64) { let (base_gas, is_static) = match MERGE_MAP[opcode as usize] { Some(opcode_info) => (opcode_info.1.gas, opcode_info.1.static_gas), None => return (0.0, 0, 0.0), @@ -1433,7 +1433,7 @@ impl From<&OpcodeRecord> for OpcodeStats { opcode_stat.count = v.0; opcode_stat.time = v.1; opcode_stat.avg_cost = convert_cycles_to_ns_f64(v.1) / v.0 as f64; - let (op_total, op_static, op_dyn) = caculate_gas(op, v.0, v.2); + let (op_total, op_static, op_dyn) = calculate_gas(op, v.0, v.2); opcode_stat.mgas = op_total / MGAS_TO_GAS as f64; opcode_stat.static_gas = Some(op_static); opcode_stat.dyn_gas = Some(op_dyn); From 205af67d5386cb37d4b70f2e9960004b410a52b0 Mon Sep 17 00:00:00 2001 From: leopardracer <136604165+leopardracer@users.noreply.github.com> Date: Wed, 5 Feb 2025 12:35:40 +0200 Subject: [PATCH 2/2] Update metric.rs --- perf-metrics/src/metrics/metric.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perf-metrics/src/metrics/metric.rs b/perf-metrics/src/metrics/metric.rs index d9f4e5d..6184c68 100644 --- a/perf-metrics/src/metrics/metric.rs +++ b/perf-metrics/src/metrics/metric.rs @@ -30,7 +30,7 @@ pub enum MetricEvent { ExecutionStageTime { /// Current block_number. block_number: u64, - /// excution duration record. + /// execution duration record. record: ExecutionDurationRecord, }, /// Amount of txs and gas in a block.