@@ -21,6 +21,8 @@ pub(crate) struct ComparisonGenerator {
2121 feature_ref_name : String ,
2222 baseline_results : Option < BenchmarkResults > ,
2323 feature_results : Option < BenchmarkResults > ,
24+ baseline_command : Option < String > ,
25+ feature_command : Option < String > ,
2426}
2527
2628/// Represents the results from a single benchmark run
@@ -89,6 +91,7 @@ pub(crate) struct RefInfo {
8991 pub summary : BenchmarkSummary ,
9092 pub start_timestamp : Option < DateTime < Utc > > ,
9193 pub end_timestamp : Option < DateTime < Utc > > ,
94+ pub reth_command : Option < String > ,
9295}
9396
9497/// Summary of the comparison between references.
@@ -142,6 +145,8 @@ impl ComparisonGenerator {
142145 feature_ref_name : args. feature_ref . clone ( ) ,
143146 baseline_results : None ,
144147 feature_results : None ,
148+ baseline_command : None ,
149+ feature_command : None ,
145150 }
146151 }
147152
@@ -206,6 +211,21 @@ impl ComparisonGenerator {
206211 Ok ( ( ) )
207212 }
208213
214+ /// Set the reth command for a reference
215+ pub ( crate ) fn set_ref_command ( & mut self , ref_type : & str , command : String ) -> Result < ( ) > {
216+ match ref_type {
217+ "baseline" => {
218+ self . baseline_command = Some ( command) ;
219+ }
220+ "feature" => {
221+ self . feature_command = Some ( command) ;
222+ }
223+ _ => return Err ( eyre ! ( "Unknown reference type: {}" , ref_type) ) ,
224+ }
225+
226+ Ok ( ( ) )
227+ }
228+
209229 /// Generate the final comparison report
210230 pub ( crate ) async fn generate_comparison_report ( & self ) -> Result < ( ) > {
211231 info ! ( "Generating comparison report..." ) ;
@@ -230,12 +250,14 @@ impl ComparisonGenerator {
230250 summary : baseline. summary . clone ( ) ,
231251 start_timestamp : baseline. start_timestamp ,
232252 end_timestamp : baseline. end_timestamp ,
253+ reth_command : self . baseline_command . clone ( ) ,
233254 } ,
234255 feature : RefInfo {
235256 ref_name : feature. ref_name . clone ( ) ,
236257 summary : feature. summary . clone ( ) ,
237258 start_timestamp : feature. start_timestamp ,
238259 end_timestamp : feature. end_timestamp ,
260+ reth_command : self . feature_command . clone ( ) ,
239261 } ,
240262 comparison_summary,
241263 per_block_comparisons,
@@ -599,6 +621,9 @@ impl ComparisonGenerator {
599621 end. format( "%Y-%m-%d %H:%M:%S UTC" )
600622 ) ;
601623 }
624+ if let Some ( ref cmd) = report. baseline . reth_command {
625+ println ! ( " Command: {}" , cmd) ;
626+ }
602627 println ! ( ) ;
603628
604629 println ! ( "Feature Summary:" ) ;
@@ -628,6 +653,9 @@ impl ComparisonGenerator {
628653 end. format( "%Y-%m-%d %H:%M:%S UTC" )
629654 ) ;
630655 }
656+ if let Some ( ref cmd) = report. feature . reth_command {
657+ println ! ( " Command: {}" , cmd) ;
658+ }
631659 println ! ( ) ;
632660 }
633661}
0 commit comments