Add host info to weight templates (#11583)

* Add host info to weight templates

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* cargo run --quiet --profile=production  --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark pallet --chain=dev --steps=50 --repeat=20 --pallet=frame_system --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/system/src/weights.rs --template=./.maintain/frame-weight-template.hbs

Co-authored-by: Parity Bot <admin@parity.io>
This commit is contained in:
Oliver Tale-Yazdi
2022-06-03 21:46:14 +02:00
committed by GitHub
parent 038e52f5e0
commit a2afadb123
14 changed files with 103 additions and 13 deletions
@@ -18,6 +18,7 @@
mod command;
mod writer;
use crate::shared::HostInfoParams;
use sc_cli::{
ExecutionStrategy, WasmExecutionMethod, WasmtimeInstantiationStrategy,
DEFAULT_WASMTIME_INSTANTIATION_STRATEGY, DEFAULT_WASM_EXECUTION_METHOD,
@@ -91,6 +92,10 @@ pub struct PalletCmd {
#[clap(long)]
pub template: Option<PathBuf>,
#[allow(missing_docs)]
#[clap(flatten)]
pub hostinfo_params: HostInfoParams,
/// Which analysis function to use when outputting benchmarks:
/// * min-squares (default)
/// * median-slopes
@@ -3,6 +3,7 @@
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION {{version}}
//! DATE: {{date}}, STEPS: `{{cmd.steps}}`, REPEAT: {{cmd.repeat}}, LOW RANGE: `{{cmd.lowest_range_values}}`, HIGH RANGE: `{{cmd.highest_range_values}}`
//! HOSTNAME: `{{hostname}}`, CPU: `{{cpuname}}`
//! EXECUTION: {{cmd.execution}}, WASM-EXECUTION: {{cmd.wasm_execution}}, CHAIN: {{cmd.chain}}, DB CACHE: {{cmd.db_cache}}
// Executed Command:
@@ -43,6 +43,8 @@ const TEMPLATE: &str = include_str!("./template.hbs");
struct TemplateData {
args: Vec<String>,
date: String,
hostname: String,
cpuname: String,
version: String,
pallet: String,
instance: String,
@@ -322,6 +324,8 @@ pub fn write_results(
let hbs_data = TemplateData {
args: args.clone(),
date: date.clone(),
hostname: cmd.hostinfo_params.hostname(),
cpuname: cmd.hostinfo_params.cpuname(),
version: VERSION.to_string(),
pallet: pallet.to_string(),
instance: instance.to_string(),