Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

bench-cli: Support JSON output #10771

Merged
merged 7 commits into from
Feb 2, 2022
Merged

bench-cli: Support JSON output #10771

merged 7 commits into from
Feb 2, 2022

Conversation

ggwpez
Copy link
Member

@ggwpez ggwpez commented Feb 1, 2022

The current output of the benchmarking-cli uses a mix of human-readable text and csv.
This MR updates it JSON to make it machine readable. Maybe needs the "breaking change" label, not sure.

  • Add --json to the benchmarking-cli: Print the raw data as json to stdout
  • Add --json-file=path: Write the raw data into a json file
  • Remove the --raw option

Example balances.json.txt

Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
@ggwpez ggwpez added A0-please_review Pull request needs code review. B5-clientnoteworthy C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit labels Feb 1, 2022
Polkadot does not compile otherwise.

Signed-off-by: Oliver Tale-Yazdi <[email protected]>
frame/benchmarking/src/utils.rs Outdated Show resolved Hide resolved
frame/benchmarking/src/utils.rs Outdated Show resolved Hide resolved
frame/benchmarking/src/utils.rs Outdated Show resolved Hide resolved
frame/benchmarking/src/utils.rs Outdated Show resolved Hide resolved
frame/benchmarking/src/utils.rs Outdated Show resolved Hide resolved
utils/frame/benchmarking-cli/src/lib.rs Outdated Show resolved Hide resolved
utils/frame/benchmarking-cli/src/lib.rs Outdated Show resolved Hide resolved
utils/frame/benchmarking-cli/src/command.rs Outdated Show resolved Hide resolved
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
utils/frame/benchmarking-cli/src/command.rs Outdated Show resolved Hide resolved
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
@ggwpez
Copy link
Member Author

ggwpez commented Feb 2, 2022

bot merge

@paritytech-processbot paritytech-processbot bot merged commit 7c63420 into master Feb 2, 2022
@paritytech-processbot paritytech-processbot bot deleted the oty-json-raw branch February 2, 2022 14:25
agryaznov pushed a commit to agryaznov/substrate that referenced this pull request Feb 4, 2022
* Add dependencies

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Make benchmark results serializable

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Add `--json[-file]` options

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Enable JSON output

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Use specific serde version

Polkadot does not compile otherwise.

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Review comments

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Review comment: fs::write

Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Wizdave97 pushed a commit to ComposableFi/substrate that referenced this pull request Feb 4, 2022
* Add dependencies

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Make benchmark results serializable

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Add `--json[-file]` options

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Enable JSON output

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Use specific serde version

Polkadot does not compile otherwise.

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Review comments

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Review comment: fs::write

Signed-off-by: Oliver Tale-Yazdi <[email protected]>
gilescope added a commit to paritytech/cumulus that referenced this pull request Feb 21, 2022
we should be using production profile for benchmarks.
--raw does not exist: paritytech/substrate#10771
@NachoPal
Copy link
Contributor

Docs should be updated accordingly: https://docs.substrate.io/v3/runtime/benchmarking/#command-argument They advice to use --raw

In what repo should I open a new issue?

gilescope added a commit to paritytech/cumulus that referenced this pull request Feb 21, 2022
we should be using production profile for benchmarks.
--raw does not exist: paritytech/substrate#10771
@ggwpez
Copy link
Member Author

ggwpez commented Feb 21, 2022

In what repo should I open a new issue?

I think we just ping DevHub on chat and ask there. @NachoPal

gilescope added a commit to gilescope/substrate-developer-hub.github.io that referenced this pull request Feb 22, 2022
grishasobol pushed a commit to gear-tech/substrate that referenced this pull request Mar 28, 2022
* Add dependencies

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Make benchmark results serializable

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Add `--json[-file]` options

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Enable JSON output

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Use specific serde version

Polkadot does not compile otherwise.

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Review comments

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Review comment: fs::write

Signed-off-by: Oliver Tale-Yazdi <[email protected]>
WebWizrd8 added a commit to WebWizrd8/cumulus that referenced this pull request Nov 21, 2022
we should be using production profile for benchmarks.
--raw does not exist: paritytech/substrate#10771
ark0f pushed a commit to gear-tech/substrate that referenced this pull request Feb 27, 2023
* Add dependencies

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Make benchmark results serializable

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Add `--json[-file]` options

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Enable JSON output

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Use specific serde version

Polkadot does not compile otherwise.

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Review comments

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Review comment: fs::write

Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants