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

@@ -68,7 +68,7 @@ use std::path::PathBuf;
use std::pin::Pin;
use std::sync::Arc;
use sysinfo::{System, SystemExt};
use system_health::{observe_nat, observe_system_health_bn};
use system_health::observe_system_health_bn;
use task_spawner::{Priority, TaskSpawner};
use tokio::sync::{
mpsc::{Sender, UnboundedSender},
@@ -3965,7 +3965,13 @@ pub fn serve<T: BeaconChainTypes>(
.and(warp::path::end())
.then(|task_spawner: TaskSpawner<T::EthSpec>| {
task_spawner.blocking_json_task(Priority::P1, move || {
Ok(api_types::GenericResponse::from(observe_nat()))
Ok(api_types::GenericResponse::from(
lighthouse_network::metrics::NAT_OPEN
.as_ref()
.map(|v| v.get())
.unwrap_or(0)
!= 0,
))
})
});