[−][src]Macro orml_benchmarking::add_benchmark
This macro adds pallet benchmarks to a Vec<BenchmarkBatch>
object.
First create an object that holds in the input parameters for the benchmark:
ⓘThis example is not tested
let params = (&pallet, &benchmark, &lowest_range_values, &highest_range_values, &steps, repeat);
Then define a mutable local variable to hold your BenchmarkBatch
object:
ⓘThis example is not tested
let mut batches = Vec::<BenchmarkBatch>::new();
Then add the pallets you want to benchmark to this object, including the string you want to use target a particular pallet:
ⓘThis example is not tested
add_benchmark!(params, batches, b"balances", Balances); add_benchmark!(params, batches, b"identity", Identity); add_benchmark!(params, batches, b"session", SessionBench::<Runtime>); ...
At the end of dispatch_benchmark
, you should return this batches object.