mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 14:37:57 +00:00
Add options to overwrite range bounds in benchmark command. (#5072)
* Add --mins --maxs to benchmark command. * Apply review suggestions.
This commit is contained in:
@@ -39,6 +39,14 @@ pub struct BenchmarkCmd {
|
||||
#[structopt(short, long, use_delimiter = true)]
|
||||
pub steps: Vec<u32>,
|
||||
|
||||
/// Indicates lowest values for each of the component ranges.
|
||||
#[structopt(long, use_delimiter = true)]
|
||||
pub lowest_range_values: Vec<u32>,
|
||||
|
||||
/// Indicates highest values for each of the component ranges.
|
||||
#[structopt(long, use_delimiter = true)]
|
||||
pub highest_range_values: Vec<u32>,
|
||||
|
||||
/// Select how many repetitions of this benchmark should run.
|
||||
#[structopt(short, long, default_value = "1")]
|
||||
pub repeat: u32,
|
||||
@@ -104,7 +112,14 @@ impl BenchmarkCmd {
|
||||
&mut changes,
|
||||
&executor,
|
||||
"Benchmark_dispatch_benchmark",
|
||||
&(&self.pallet, &self.extrinsic, self.steps.clone(), self.repeat).encode(),
|
||||
&(
|
||||
&self.pallet,
|
||||
&self.extrinsic,
|
||||
self.lowest_range_values.clone(),
|
||||
self.highest_range_values.clone(),
|
||||
self.steps.clone(),
|
||||
self.repeat,
|
||||
).encode(),
|
||||
Default::default(),
|
||||
)
|
||||
.execute(strategy.into())
|
||||
@@ -117,9 +132,11 @@ impl BenchmarkCmd {
|
||||
Ok(results) => {
|
||||
// Print benchmark metadata
|
||||
println!(
|
||||
"Pallet: {:?}, Extrinsic: {:?}, Steps: {:?}, Repeat: {:?}",
|
||||
"Pallet: {:?}, Extrinsic: {:?}, Lowest values: {:?}, Highest values: {:?}, Steps: {:?}, Repeat: {:?}",
|
||||
self.pallet,
|
||||
self.extrinsic,
|
||||
self.lowest_range_values,
|
||||
self.highest_range_values,
|
||||
self.steps,
|
||||
self.repeat,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user