mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-11 22:21:07 +00:00
Enable trace timings logs for transaction factory (#4845)
* Enable trace timings logs for transaction factory.
This commit is contained in:
Generated
+2
@@ -3400,6 +3400,7 @@ dependencies = [
|
|||||||
"sc-service",
|
"sc-service",
|
||||||
"sc-service-test",
|
"sc-service-test",
|
||||||
"sc-telemetry",
|
"sc-telemetry",
|
||||||
|
"sc-tracing",
|
||||||
"sc-transaction-pool",
|
"sc-transaction-pool",
|
||||||
"serde",
|
"serde",
|
||||||
"sp-authority-discovery",
|
"sp-authority-discovery",
|
||||||
@@ -3417,6 +3418,7 @@ dependencies = [
|
|||||||
"structopt",
|
"structopt",
|
||||||
"substrate-build-script-utils",
|
"substrate-build-script-utils",
|
||||||
"tempfile",
|
"tempfile",
|
||||||
|
"tracing",
|
||||||
"vergen",
|
"vergen",
|
||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
"wasm-bindgen-futures",
|
"wasm-bindgen-futures",
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ jsonrpc-core = "14.0.3"
|
|||||||
log = "0.4.8"
|
log = "0.4.8"
|
||||||
rand = "0.7.2"
|
rand = "0.7.2"
|
||||||
structopt = { version = "0.3.8", optional = true }
|
structopt = { version = "0.3.8", optional = true }
|
||||||
|
tracing = "0.1.10"
|
||||||
|
|
||||||
# primitives
|
# primitives
|
||||||
sp-authority-discovery = { version = "2.0.0", path = "../../../primitives/authority-discovery" }
|
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-rpc = { version = "2.0.0", path = "../../../client/rpc" }
|
||||||
sc-basic-authorship = { version = "0.8", path = "../../../client/basic-authorship" }
|
sc-basic-authorship = { version = "0.8", path = "../../../client/basic-authorship" }
|
||||||
sc-service = { version = "0.8", default-features = false, path = "../../../client/service" }
|
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-telemetry = { version = "2.0.0", path = "../../../client/telemetry" }
|
||||||
sc-authority-discovery = { version = "0.8", path = "../../../client/authority-discovery" }
|
sc-authority-discovery = { version = "0.8", path = "../../../client/authority-discovery" }
|
||||||
|
|
||||||
|
|||||||
@@ -56,6 +56,16 @@ where
|
|||||||
_ => panic!("Factory is only supported for development and local testnet."),
|
_ => 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(
|
let factory_state = FactoryState::new(
|
||||||
cli_args.mode.clone(),
|
cli_args.mode.clone(),
|
||||||
cli_args.num,
|
cli_args.num,
|
||||||
|
|||||||
@@ -638,8 +638,8 @@ where
|
|||||||
config.telemetry_endpoints = Some(TelemetryEndpoints::new(cli.telemetry_endpoints));
|
config.telemetry_endpoints = Some(TelemetryEndpoints::new(cli.telemetry_endpoints));
|
||||||
}
|
}
|
||||||
|
|
||||||
config.tracing_targets = cli.tracing_targets.into();
|
config.tracing_targets = cli.shared_params.tracing_targets.into();
|
||||||
config.tracing_receiver = cli.tracing_receiver.into();
|
config.tracing_receiver = cli.shared_params.tracing_receiver.into();
|
||||||
|
|
||||||
// Imply forced authoring on --dev
|
// Imply forced authoring on --dev
|
||||||
config.force_authoring = cli.shared_params.dev || cli.force_authoring;
|
config.force_authoring = cli.shared_params.dev || cli.force_authoring;
|
||||||
|
|||||||
@@ -113,6 +113,20 @@ pub struct SharedParams {
|
|||||||
/// Sets a custom logging filter.
|
/// Sets a custom logging filter.
|
||||||
#[structopt(short = "l", long = "log", value_name = "LOG_PATTERN")]
|
#[structopt(short = "l", long = "log", value_name = "LOG_PATTERN")]
|
||||||
pub log: Option<String>,
|
pub log: Option<String>,
|
||||||
|
|
||||||
|
/// Comma separated list of targets for tracing
|
||||||
|
#[structopt(long = "tracing-targets", value_name = "TARGETS")]
|
||||||
|
pub tracing_targets: Option<String>,
|
||||||
|
|
||||||
|
/// Receiver to process tracing messages
|
||||||
|
#[structopt(
|
||||||
|
long = "tracing-receiver",
|
||||||
|
value_name = "RECEIVER",
|
||||||
|
possible_values = &TracingReceiver::variants(),
|
||||||
|
case_insensitive = true,
|
||||||
|
default_value = "Log"
|
||||||
|
)]
|
||||||
|
pub tracing_receiver: TracingReceiver,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Parameters for block import.
|
/// Parameters for block import.
|
||||||
@@ -579,20 +593,6 @@ pub struct RunCmd {
|
|||||||
#[structopt(long = "force-authoring")]
|
#[structopt(long = "force-authoring")]
|
||||||
pub force_authoring: bool,
|
pub force_authoring: bool,
|
||||||
|
|
||||||
/// Comma separated list of targets for tracing
|
|
||||||
#[structopt(long = "tracing-targets", value_name = "TARGETS")]
|
|
||||||
pub tracing_targets: Option<String>,
|
|
||||||
|
|
||||||
/// Receiver to process tracing messages
|
|
||||||
#[structopt(
|
|
||||||
long = "tracing-receiver",
|
|
||||||
value_name = "RECEIVER",
|
|
||||||
possible_values = &TracingReceiver::variants(),
|
|
||||||
case_insensitive = true,
|
|
||||||
default_value = "Log"
|
|
||||||
)]
|
|
||||||
pub tracing_receiver: TracingReceiver,
|
|
||||||
|
|
||||||
/// Specify custom keystore path.
|
/// Specify custom keystore path.
|
||||||
#[structopt(long = "keystore-path", value_name = "PATH", parse(from_os_str))]
|
#[structopt(long = "keystore-path", value_name = "PATH", parse(from_os_str))]
|
||||||
pub keystore_path: Option<PathBuf>,
|
pub keystore_path: Option<PathBuf>,
|
||||||
|
|||||||
Reference in New Issue
Block a user