mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 20:27:58 +00:00
More Improvements to Benchmarking CLI + Generic WeightInfo (#7168)
* Generic WeightInfo, Output File Path * Make `WeightInfo` generic * Add support for header file * fix line width * add `--spaces` flag * Configurable trait and struct strings * make elections phragmen generic * Add date to generated file * Apply suggestions from code review Co-authored-by: Gavin Wood <gavin@parity.io> * fixes * add settings metadata to output Co-authored-by: nikvolf <nikvolf@gmail.com> Co-authored-by: Gavin Wood <gavin@parity.io>
This commit is contained in:
@@ -60,13 +60,17 @@ pub struct BenchmarkCmd {
|
||||
#[structopt(long)]
|
||||
pub no_min_squares: bool,
|
||||
|
||||
/// Output the benchmarks to a Rust file.
|
||||
/// Output the benchmarks to a Rust file at the given path.
|
||||
#[structopt(long)]
|
||||
pub output: bool,
|
||||
pub output: Option<std::path::PathBuf>,
|
||||
|
||||
/// Add a header file to your outputted benchmarks
|
||||
#[structopt(long)]
|
||||
pub header: Option<std::path::PathBuf>,
|
||||
|
||||
/// Output the trait definition to a Rust file.
|
||||
#[structopt(long)]
|
||||
pub weight_trait: bool,
|
||||
pub trait_def: bool,
|
||||
|
||||
/// Set the heap pages while running benchmarks.
|
||||
#[structopt(long)]
|
||||
@@ -80,6 +84,18 @@ 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,
|
||||
|
||||
Reference in New Issue
Block a user