Enable trace timings logs for transaction factory (#4845)

* Enable trace timings logs for transaction factory.
This commit is contained in:
Marcio Diaz
2020-02-07 08:12:19 +01:00
committed by GitHub
parent 8c373916a4
commit 41644c2ae8
5 changed files with 30 additions and 16 deletions
+2
View File
@@ -32,6 +32,7 @@ jsonrpc-core = "14.0.3"
log = "0.4.8"
rand = "0.7.2"
structopt = { version = "0.3.8", optional = true }
tracing = "0.1.10"
# primitives
sp-authority-discovery = { version = "2.0.0", path = "../../../primitives/authority-discovery" }
@@ -60,6 +61,7 @@ sc-offchain = { version = "2.0.0", path = "../../../client/offchain" }
sc-rpc = { version = "2.0.0", path = "../../../client/rpc" }
sc-basic-authorship = { version = "0.8", path = "../../../client/basic-authorship" }
sc-service = { version = "0.8", default-features = false, path = "../../../client/service" }
sc-tracing = { version = "2.0.0", path = "../../../client/tracing" }
sc-telemetry = { version = "2.0.0", path = "../../../client/telemetry" }
sc-authority-discovery = { version = "0.8", path = "../../../client/authority-discovery" }
+10
View File
@@ -56,6 +56,16 @@ where
_ => panic!("Factory is only supported for development and local testnet."),
}
// Setup tracing.
if let Some(tracing_targets) = cli_args.shared_params.tracing_targets.as_ref() {
let subscriber = sc_tracing::ProfilingSubscriber::new(
cli_args.shared_params.tracing_receiver.into(), tracing_targets
);
if let Err(e) = tracing::subscriber::set_global_default(subscriber) {
panic!("Unable to set global default subscriber {}", e);
}
}
let factory_state = FactoryState::new(
cli_args.mode.clone(),
cli_args.num,