Revert libp2p metrics (#4870) (#5265)

* Revert "improve libp2p connected peer metrics (#4870)"

This reverts commit 0c3fef59b3.
This commit is contained in:
Jimmy Chen
2024-02-20 15:19:17 +11:00
committed by GitHub
parent a229b52723
commit 50c423ad88
7 changed files with 100 additions and 65 deletions

View File

@@ -198,25 +198,6 @@ pub fn observe_system_health_vc(
}
}
/// Observes if NAT traversal is possible.
pub fn observe_nat() -> bool {
let discv5_nat = lighthouse_network::metrics::get_int_gauge(
&lighthouse_network::metrics::NAT_OPEN,
&["discv5"],
)
.map(|g| g.get() == 1)
.unwrap_or_default();
let libp2p_nat = lighthouse_network::metrics::get_int_gauge(
&lighthouse_network::metrics::NAT_OPEN,
&["libp2p"],
)
.map(|g| g.get() == 1)
.unwrap_or_default();
discv5_nat && libp2p_nat
}
/// Observes the Beacon Node system health.
pub fn observe_system_health_bn<TSpec: EthSpec>(
sysinfo: Arc<RwLock<System>>,
@@ -242,7 +223,11 @@ pub fn observe_system_health_bn<TSpec: EthSpec>(
.unwrap_or_else(|| (String::from("None"), 0, 0));
// Determine if the NAT is open or not.
let nat_open = observe_nat();
let nat_open = lighthouse_network::metrics::NAT_OPEN
.as_ref()
.map(|v| v.get())
.unwrap_or(0)
!= 0;
SystemHealthBN {
system_health,