Trait Benchmarking
pub trait Benchmarking {
// Required methods
fn benchmarks(extra: bool) -> Vec<BenchmarkMetadata>;
fn run_benchmark(
name: &[u8],
selected_components: &[(BenchmarkParameter, u32)],
whitelist: &[TrackedStorageKey],
verify: bool,
internal_repeats: u32,
) -> Result<Vec<BenchmarkResult>, BenchmarkError>;
}Expand description
The pallet benchmarking trait.
Required Methods§
fn benchmarks(extra: bool) -> Vec<BenchmarkMetadata>
fn benchmarks(extra: bool) -> Vec<BenchmarkMetadata>
Get the benchmarks available for this pallet. Generally there is one benchmark per extrinsic, so these are sometimes just called “extrinsics”.
Parameters
extra: Also return benchmarks marked “extra” which would otherwise not be needed for weight calculation.
fn run_benchmark(
name: &[u8],
selected_components: &[(BenchmarkParameter, u32)],
whitelist: &[TrackedStorageKey],
verify: bool,
internal_repeats: u32,
) -> Result<Vec<BenchmarkResult>, BenchmarkError>
fn run_benchmark( name: &[u8], selected_components: &[(BenchmarkParameter, u32)], whitelist: &[TrackedStorageKey], verify: bool, internal_repeats: u32, ) -> Result<Vec<BenchmarkResult>, BenchmarkError>
Run the benchmarks for this pallet.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
§impl<T> Benchmarking for Pallet<T>where
T: Config + Config,
Available on crate features runtime-benchmarks only.
impl<T> Benchmarking for Pallet<T>where
T: Config + Config,
Available on crate features
runtime-benchmarks only.fn benchmarks(extra: bool) -> Vec<BenchmarkMetadata>
fn run_benchmark( extrinsic: &[u8], c: &[(BenchmarkParameter, u32)], whitelist: &[TrackedStorageKey], verify: bool, internal_repeats: u32, ) -> Result<Vec<BenchmarkResult>, BenchmarkError>
§impl<T> Benchmarking for Pallet<T>where
T: Send + Sync + Config,
<T as Config>::RuntimeCall: Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo>,
<<T as Config>::RuntimeCall as Dispatchable>::RuntimeOrigin: AsSystemOriginSigner<<T as Config>::AccountId> + AsTransactionAuthorizedOrigin + Clone,
Available on crate features runtime-benchmarks only.
impl<T> Benchmarking for Pallet<T>where
T: Send + Sync + Config,
<T as Config>::RuntimeCall: Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo>,
<<T as Config>::RuntimeCall as Dispatchable>::RuntimeOrigin: AsSystemOriginSigner<<T as Config>::AccountId> + AsTransactionAuthorizedOrigin + Clone,
Available on crate features
runtime-benchmarks only.fn benchmarks(extra: bool) -> Vec<BenchmarkMetadata>
fn run_benchmark( extrinsic: &[u8], c: &[(BenchmarkParameter, u32)], whitelist: &[TrackedStorageKey], verify: bool, internal_repeats: u32, ) -> Result<Vec<BenchmarkResult>, BenchmarkError>
Implementors§
impl<T> Benchmarking for polkadot_sdk_frame::benchmarking::prelude::baseline::Pallet<T>
Available on crate features
runtime-benchmarks only.