Function weightanalyzer::analyze_weight
source · pub fn analyze_weight(
folder_path: &Path,
max_block_weight: &MaxBlockWeight,
) -> Result<HashMap<String, HashMap<String, WeightInfo>>, String>
Expand description
Returns a HashMap <pallet_name, <extrinsic_name, weigh_info>> of the analyzed weights.
§Arguments
folder_path
- A Path to a folder where the weight files are stored.paritydb_weights.rs
is mandatory and pallet weights should start bypallet_
.max_block_weight
- The maximal weight of a block.
§Examples
use weightanalyzer::analyze_weight;
use std::path::Path;
use weightanalyzer::MaxBlockWeight;
let weight_by_pallet = analyze_weight(Path::new("../../runtime/gdev/src/weights/"), &MaxBlockWeight::default());
println!("{:?}", weight_by_pallet);