Use Handlebars Template for Benchmark CLI Output (#7390)

* add_handlebar_template_to_benchmark

- add benchmark-cli arg to take in a handlebar-template file

* update to always use template

* rewrite writer for handlebars

* polish

* pass cmd data

* update docs

* support custom filename output

* Update command.rs

* Create frame-weight-template.hbs

* use a vector to maintain benchmark order

* fix tests

* Custom string serializer, remove feature flag

* update docs

* docs on public objects

* small fix

Co-authored-by: Ezadkiel Marbella <zadkiel.m@gmail.com>
This commit is contained in:
Shawn Tabrizi
2020-10-27 13:25:57 +01:00
committed by GitHub
parent 21d1cd0c89
commit 3ac070b61e
8 changed files with 598 additions and 316 deletions
@@ -68,9 +68,9 @@ pub struct BenchmarkCmd {
#[structopt(long)]
pub header: Option<std::path::PathBuf>,
/// Output the trait definition to a Rust file.
/// Path to Handlebars template file used for outputting benchmark results. (Optional)
#[structopt(long)]
pub trait_def: bool,
pub template: Option<std::path::PathBuf>,
/// Set the heap pages while running benchmarks.
#[structopt(long)]
@@ -84,18 +84,6 @@ pub struct BenchmarkCmd {
#[structopt(long)]
pub extra: bool,
/// Output files using spaces instead of tabs.
#[structopt(long)]
pub spaces: bool,
/// Output benchmarks file using this struct name.
#[structopt(long, default_value = "WeightInfo")]
pub r#struct: String,
/// Output benchmarks file using this trait name.
#[structopt(long, default_value = "WeightInfo")]
pub r#trait: String,
#[allow(missing_docs)]
#[structopt(flatten)]
pub shared_params: sc_cli::SharedParams,