mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-19 22:08:30 +00:00
Do not compute metrics in the network service if the cli flag is not set (#2765)
## Issue Addressed The computation of metrics in the network service can be expensive. This disables the computation unless the cli flag `metrics` is set. ## Additional Info Metrics in other parts of the network are still updated, since most are simple metrics and checking if metrics are enabled each time each metric is updated doesn't seem like a gain.
This commit is contained in:
@@ -705,6 +705,10 @@ pub fn set_network_config(
|
||||
config.private = true;
|
||||
}
|
||||
|
||||
if cli_args.is_present("metrics") {
|
||||
config.metrics_enabled = true;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user