Add --header to benchmark overhead + storage (#12204)

* Add header to 'overhead' command

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

* Add header to 'storage' command

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

* Update READMEs

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

* Apply suggestions from code review

Co-authored-by: Bastian Köcher <info@kchr.de>

* .as_ref() and fmt

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

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Bastian Köcher <info@kchr.de>
This commit is contained in:
Oliver Tale-Yazdi
2022-09-07 23:16:54 +02:00
committed by GitHub
parent 99d8111c67
commit 09ec484139
9 changed files with 41 additions and 39 deletions
@@ -79,6 +79,12 @@ pub struct StorageParams {
#[clap(long)]
pub template_path: Option<PathBuf>,
/// Add a header to the generated weight output file.
///
/// Good for adding LICENSE headers.
#[clap(long, value_name = "PATH")]
pub header: Option<PathBuf>,
/// Path to write the raw 'read' results in JSON format to. Can be a file or directory.
#[clap(long)]
pub json_read_path: Option<PathBuf>,
@@ -122,7 +128,7 @@ impl StorageCmd {
Block: BlockT<Hash = DbHash>,
C: UsageProvider<Block> + StorageProvider<Block, BA> + HeaderBackend<Block>,
{
let mut template = TemplateData::new(&cfg, &self.params);
let mut template = TemplateData::new(&cfg, &self.params)?;
let block_id = BlockId::<Block>::Number(client.usage_info().chain.best_number);
template.set_block_number(block_id.to_string());