create parallel tasks extension (#5249)

This commit is contained in:
Nikolay Volf
2020-03-16 08:30:39 -07:00
committed by GitHub
parent 418b7b8bc2
commit 372745705d
25 changed files with 189 additions and 26 deletions
@@ -10,6 +10,7 @@ description = "CLI for benchmarking FRAME"
[dependencies]
frame-benchmarking = { version = "2.0.0-alpha.2", path = "../../../frame/benchmarking" }
sp-core = { version = "2.0.0-alpha.2", path = "../../../primitives/core" }
sc-service = { version = "0.8.0-alpha.2", default-features = false, path = "../../../client/service" }
sc-cli = { version = "0.8.0-alpha.2", path = "../../../client/cli" }
sc-client = { version = "0.8.0-alpha.2", path = "../../../client" }
@@ -23,6 +23,7 @@ use sc_service::{Configuration, ChainSpec};
use sc_executor::{NativeExecutor, NativeExecutionDispatch};
use codec::{Encode, Decode};
use frame_benchmarking::BenchmarkResults;
use sp_core::tasks;
/// The `benchmark` command used to benchmark FRAME Pallets.
#[derive(Debug, structopt::StructOpt, Clone)]
@@ -121,6 +122,7 @@ impl BenchmarkCmd {
).encode(),
Default::default(),
&sp_state_machine::backend::BackendRuntimeCode::new(&state).runtime_code()?,
tasks::executor(),
)
.execute(strategy.into())
.map_err(|e| format!("Error executing runtime benchmark: {:?}", e))?;