Add options to overwrite range bounds in benchmark command. (#5072)

* Add --mins --maxs to benchmark command.

* Apply review suggestions.
This commit is contained in:
Marcio Diaz
2020-02-28 15:40:42 +01:00
committed by GitHub
parent d39605d9cd
commit 347b5d641c
4 changed files with 81 additions and 16 deletions
+11 -1
View File
@@ -41,6 +41,8 @@ sp_api::decl_runtime_apis! {
fn dispatch_benchmark(
module: Vec<u8>,
extrinsic: Vec<u8>,
lowest_range_values: Vec<u32>,
highest_range_values: Vec<u32>,
steps: Vec<u32>,
repeat: u32,
) -> Result<Vec<BenchmarkResults>, RuntimeString>;
@@ -78,8 +80,16 @@ pub trait Benchmarking<T> {
/// Parameters
/// - `extrinsic`: The name of extrinsic function you want to benchmark encoded as bytes.
/// - `steps`: The number of sample points you want to take across the range of parameters.
/// - `lowest_range_values`: The lowest number for each range of parameters.
/// - `highest_range_values`: The highest number for each range of parameters.
/// - `repeat`: The number of times you want to repeat a benchmark.
fn run_benchmark(extrinsic: Vec<u8>, steps: Vec<u32>, repeat: u32) -> Result<Vec<T>, &'static str>;
fn run_benchmark(
extrinsic: Vec<u8>,
lowest_range_values: Vec<u32>,
highest_range_values: Vec<u32>,
steps: Vec<u32>,
repeat: u32,
) -> Result<Vec<T>, &'static str>;
}
/// The required setup for creating a benchmark.