mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
improve libp2p connected peer metrics (#4870)
* improve libp2p connected peer metrics * separate discv5 port from libp2p for NAT open * use metric family for DISCOVERY_BYTES * Merge branch 'unstable' of https://github.com/sigp/lighthouse into improve-metrics
This commit is contained in:
@@ -67,7 +67,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},
|
||||
@@ -4071,13 +4071,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()))
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user