improve libp2p connected peer metrics (#5314)

* patch rust-yamux dep

* improve libp2p connected peer metrics
This commit is contained in:
João Oliveira
2024-02-28 03:52:55 +00:00
committed by GitHub
parent 65c4ff0775
commit a89ff100af
8 changed files with 64 additions and 113 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_system_health_bn;
use system_health::{observe_nat, observe_system_health_bn};
use task_spawner::{Priority, TaskSpawner};
use tokio::sync::{
mpsc::{Sender, UnboundedSender},
@@ -3965,13 +3965,7 @@ 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(
lighthouse_network::metrics::NAT_OPEN
.as_ref()
.map(|v| v.get())
.unwrap_or(0)
!= 0,
))
Ok(api_types::GenericResponse::from(observe_nat()))
})
});