Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module implements API for benchmarking dispatchable extrinsic calls and system hooks. For more information about the benchmarking process, see: /docs/docs/development/benchmarking.md
func New ¶
func New(systemIndex sc.U8, modules []primitives.Module, decoder types.RuntimeDecoder, storage io.Storage, transactionBroker io.TransactionBroker, logger log.RuntimeLogger) Module
func (Module) BenchmarkDispatch ¶
BenchmarkDispatch benchmarks the execution of dispatchable calls. It takes two arguments: - dataPtr: Pointer to the data in the Wasm memory. - dataLen: Length of the data. which represent the SCALE-encoded benchmarking configuration.
Executes a dispatch extrinsic call N times in isolated environment by measuring the elapsed time in each execution.
Returns a pointer-size of the SCALE-encoded benchmarking result.
TODO: Implement DbCommit, DbWipe once the state implementation in Gossamer supports caching and nested transactions. https://github.com/ChainSafe/gossamer/discussions/3646
func (Module) BenchmarkHook ¶
BenchmarkHook benchmarks the execution of system hooks. It takes two arguments: - dataPtr: Pointer to the data in the Wasm memory. - dataLen: Length of the data. which represent the SCALE-encoded benchmarking configuration.
Based on the provided system hook, it executes it for each of the preconfigured runtime modules and sums their execution elapsed time.
Returns a pointer-size of the SCALE-encoded benchmarking result.