-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
77 additions
and
32 deletions.
There are no files selected for viewing
18 changes: 9 additions & 9 deletions
18
.snippets/code/develop/parachains/testing/benchmarking/benchmark-output.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
<div id="termynal" data-termynal> | ||
<span data-ty="input"><span class="file-path"></span>./target/release/INSERT_NODE_BINARY_NAME benchmark pallet \ --runtime INSERT_PATH_TO_WASM_RUNTIME \ --pallet INSERT_PALLET_NAME \ --extrinsic '*' \ --steps 20 \ --repeat 10 \ --output weights.rs</span> | ||
<span data-ty>2024-10-28 11:07:25 Loading WASM from ./target/release/wbuild/educhain-runtime/educhain_runtime.wasm</span> | ||
<span data-ty>2024-10-28 11:07:26 Could not find genesis preset 'development'. Falling back to default.</span> | ||
<span data-ty>2024-10-28 11:07:26 assembling new collators for new session 0 at #0</span> | ||
<span data-ty>2024-10-28 11:07:26 assembling new collators for new session 1 at #0</span> | ||
<span data-ty>2024-10-28 11:07:26 Loading WASM from ./target/release/wbuild/educhain-runtime/educhain_runtime.wasm</span> | ||
<span data-ty>Pallet: "pallet_parachain_template", Extrinsic: "do_something", Lowest values: [], Highest values: [], Steps: 20, Repeat: 10</span> | ||
<span data-ty="input"><span class="file-path"></span>frame-omni-bencher v1 benchmark pallet \</span> | ||
<span data-ty>--runtime INSERT_PATH_TO_WASM_RUNTIME \</span> | ||
<span data-ty>--pallet "INSERT_NAME_OF_PALLET" \</span> | ||
<span data-ty>--extrinsic "" \</span> | ||
<span data-ty>--template ./frame-weight-template.hbs \</span> | ||
<span data-ty>--output ./weights.rs</span> | ||
<span data-ty>...</span> | ||
<span data-ty>2025-01-15T16:41:33.557045Z INFO polkadot_sdk_frame::benchmark::pallet: [ 0 % ] Starting benchmark: pallet_parachain_template::do_something</span> | ||
<span data-ty>2025-01-15T16:41:33.564644Z INFO polkadot_sdk_frame::benchmark::pallet: [ 50 % ] Starting benchmark: pallet_parachain_template::cause_error</span> | ||
<span data-ty>...</span> | ||
<span data-ty>Created file: "weights.rs"</span> | ||
<span data-ty>2024-10-28 11:07:27 [ 0 % ] Starting benchmark: pallet_parachain_template::do_something</span> | ||
<span data-ty>I2024-10-28 11:07:27 [ 50 % ] Starting benchmark: pallet_parachain_template::cause_error</span> | ||
<span data-ty="input"><span class="file-path"></span></span> | ||
</div> |
4 changes: 4 additions & 0 deletions
4
.snippets/code/develop/parachains/testing/benchmarking/runtime-cargo.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
runtime-benchmarks = [ | ||
# ... | ||
"pallet_parachain_template/runtime-benchmarks", | ||
] |
5 changes: 5 additions & 0 deletions
5
.snippets/code/develop/parachains/testing/benchmarking/runtime-pallet-config.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// Configure pallet. | ||
impl pallet_parachain_template::Config for Runtime { | ||
// ... | ||
type WeightInfo = pallet_parachain_template::weights::SubstrateWeight<Runtime>; | ||
} |
2 changes: 2 additions & 0 deletions
2
.snippets/code/develop/parachains/testing/benchmarking/weight-config.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
pub mod weights; | ||
use crate::weights::WeightInfo; | ||
|
||
/// Configure the pallet by specifying the parameters and types on which it depends. | ||
#[pallet::config] | ||
pub trait Config: frame_system::Config { | ||
// ... | ||
/// A type representing the weights required by the dispatchables of this pallet. | ||
type WeightInfo: WeightInfo; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters