mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-19 13:31:04 +00:00
Add hardware benchmark telemetry (Companion for Substrate#11062) (#5206)
* Align to changes in Substrate * Align to the newest changes in substrate * Rename `--disable-hardware-benchmarks` to `--no-hardware-benchmarks` * Fix `polkadot-test-service` compilation * Fix compilation of test parachains
This commit is contained in:
@@ -128,6 +128,16 @@ pub struct RunCmd {
|
||||
/// commonly `127.0.0.1:4040`.
|
||||
#[clap(long)]
|
||||
pub pyroscope_server: Option<String>,
|
||||
|
||||
/// Disable automatic hardware benchmarks.
|
||||
///
|
||||
/// By default these benchmarks are automatically ran at startup and measure
|
||||
/// the CPU speed, the memory bandwidth and the disk speed.
|
||||
///
|
||||
/// The results are then printed out in the logs, and also sent as part of
|
||||
/// telemetry, if telemetry is enabled.
|
||||
#[clap(long)]
|
||||
pub no_hardware_benchmarks: bool,
|
||||
}
|
||||
|
||||
#[allow(missing_docs)]
|
||||
|
||||
@@ -302,6 +302,15 @@ where
|
||||
};
|
||||
|
||||
runner.run_node_until_exit(move |config| async move {
|
||||
let hwbench = if !cli.run.no_hardware_benchmarks {
|
||||
config.database.path().map(|database_path| {
|
||||
let _ = std::fs::create_dir_all(&database_path);
|
||||
sc_sysinfo::gather_hwbench(Some(database_path))
|
||||
})
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
let role = config.role.clone();
|
||||
|
||||
match role {
|
||||
@@ -315,6 +324,7 @@ where
|
||||
None,
|
||||
false,
|
||||
overseer_gen,
|
||||
hwbench,
|
||||
)
|
||||
.map(|full| full.task_manager)
|
||||
.map_err(Into::into),
|
||||
|
||||
Reference in New Issue
Block a user