bench-cli: Support JSON output (#10771)

* Add dependencies

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

* Make benchmark results serializable

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

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

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

* Enable JSON output

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

* Use specific serde version

Polkadot does not compile otherwise.

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

* Review comments

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

* Review comment: fs::write

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
Oliver Tale-Yazdi
2022-02-02 15:25:13 +01:00
committed by GitHub
parent 46f4396657
commit 99fae0cd57
6 changed files with 84 additions and 46 deletions
+2
View File
@@ -27,6 +27,7 @@ sp-storage = { version = "5.0.0", path = "../../primitives/storage", default-fea
frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" }
frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" }
log = { version = "0.4.14", default-features = false }
serde = { version = "1.0.132", optional = true }
[dev-dependencies]
hex-literal = "0.3.4"
@@ -37,6 +38,7 @@ default = ["std"]
std = [
"codec/std",
"scale-info/std",
"serde",
"sp-runtime-interface/std",
"sp-runtime/std",
"sp-api/std",