diff --git a/substrate/utils/frame/benchmarking-cli/src/command.rs b/substrate/utils/frame/benchmarking-cli/src/command.rs index 05e380a37e..5efa970d93 100644 --- a/substrate/utils/frame/benchmarking-cli/src/command.rs +++ b/substrate/utils/frame/benchmarking-cli/src/command.rs @@ -407,6 +407,20 @@ impl BenchmarkCmd { println!(); } + if !self.no_storage_info { + let mut comments: Vec = Default::default(); + crate::writer::add_storage_comments( + &mut comments, + &batch.db_results, + &storage_info, + ); + println!("Raw Storage Info\n========"); + for comment in comments { + println!("{}", comment); + } + println!(""); + } + // Conduct analysis. if !self.no_median_slopes { println!("Median Slopes Analysis\n========"); @@ -425,6 +439,7 @@ impl BenchmarkCmd { { println!("Writes = {:?}", analysis); } + println!(""); } if !self.no_min_squares { println!("Min Squares Analysis\n========"); @@ -443,6 +458,7 @@ impl BenchmarkCmd { { println!("Writes = {:?}", analysis); } + println!(""); } } diff --git a/substrate/utils/frame/benchmarking-cli/src/lib.rs b/substrate/utils/frame/benchmarking-cli/src/lib.rs index cd314adebe..316ddfb8d0 100644 --- a/substrate/utils/frame/benchmarking-cli/src/lib.rs +++ b/substrate/utils/frame/benchmarking-cli/src/lib.rs @@ -141,4 +141,11 @@ pub struct BenchmarkCmd { /// When nothing is provided, we list all benchmarks. #[structopt(long)] pub list: bool, + + /// If enabled, the storage info is not displayed in the output next to the analysis. + /// + /// This is independent of the storage info appearing in the *output file*. Use a Handlebar + /// template for that purpose. + #[structopt(long)] + pub no_storage_info: bool, } diff --git a/substrate/utils/frame/benchmarking-cli/src/writer.rs b/substrate/utils/frame/benchmarking-cli/src/writer.rs index ae3e2dc096..b6b97f2517 100644 --- a/substrate/utils/frame/benchmarking-cli/src/writer.rs +++ b/substrate/utils/frame/benchmarking-cli/src/writer.rs @@ -357,7 +357,7 @@ pub fn write_results( // This function looks at the keys touched during the benchmark, and the storage info we collected // from the pallets, and creates comments with information about the storage keys touched during // each benchmark. -fn add_storage_comments( +pub(crate) fn add_storage_comments( comments: &mut Vec, results: &[BenchmarkResult], storage_info: &[StorageInfo],