diff --git a/bin/reth-bench/src/bench/new_payload_fcu.rs b/bin/reth-bench/src/bench/new_payload_fcu.rs index 190217f6a8cf..1ea681ba87e2 100644 --- a/bin/reth-bench/src/bench/new_payload_fcu.rs +++ b/bin/reth-bench/src/bench/new_payload_fcu.rs @@ -125,7 +125,8 @@ impl Command { // calculate the total duration and the fcu latency, record let total_latency = start.elapsed(); let fcu_latency = total_latency - new_payload_result.latency; - let combined_result = CombinedResult { new_payload_result, fcu_latency, total_latency }; + let combined_result = + CombinedResult { block_number, new_payload_result, fcu_latency, total_latency }; // current duration since the start of the benchmark let current_duration = total_benchmark_duration.elapsed(); diff --git a/bin/reth-bench/src/bench/output.rs b/bin/reth-bench/src/bench/output.rs index 83103418d929..8f68dac45336 100644 --- a/bin/reth-bench/src/bench/output.rs +++ b/bin/reth-bench/src/bench/output.rs @@ -64,6 +64,8 @@ impl Serialize for NewPayloadResult { /// latency. #[derive(Debug)] pub(crate) struct CombinedResult { + /// The block number of the block being processed. + pub(crate) block_number: u64, /// The `newPayload` result. pub(crate) new_payload_result: NewPayloadResult, /// The latency of the `forkchoiceUpdated` call. @@ -83,7 +85,8 @@ impl std::fmt::Display for CombinedResult { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!( f, - "Payload processed at {:.4} Ggas/s, used {} total gas. Combined gas per second: {:.4} Ggas/s. fcu latency: {:?}, newPayload latency: {:?}", + "Payload {} processed at {:.4} Ggas/s, used {} total gas. Combined gas per second: {:.4} Ggas/s. fcu latency: {:?}, newPayload latency: {:?}", + self.block_number, self.new_payload_result.gas_per_second() / GIGAGAS as f64, self.new_payload_result.gas_used, self.combined_gas_per_second() / GIGAGAS as f64, @@ -104,9 +107,10 @@ impl Serialize for CombinedResult { let fcu_latency = self.fcu_latency.as_micros(); let new_payload_latency = self.new_payload_result.latency.as_micros(); let total_latency = self.total_latency.as_micros(); - let mut state = serializer.serialize_struct("CombinedResult", 4)?; + let mut state = serializer.serialize_struct("CombinedResult", 5)?; // flatten the new payload result because this is meant for CSV writing + state.serialize_field("block_number", &self.block_number)?; state.serialize_field("gas_used", &self.new_payload_result.gas_used)?; state.serialize_field("new_payload_latency", &new_payload_latency)?; state.serialize_field("fcu_latency", &fcu_latency)?;