From 55bdd51cfdcfcbfd0cdafb546c28eed5a2c00d4c Mon Sep 17 00:00:00 2001 From: Miguel Date: Thu, 7 Dec 2023 16:12:38 -0500 Subject: [PATCH] pool: remove old metrics --- core/pool/src/connection/mod.rs | 35 --------------------------------- 1 file changed, 35 deletions(-) diff --git a/core/pool/src/connection/mod.rs b/core/pool/src/connection/mod.rs index 87d3c357f..9092f4c1b 100644 --- a/core/pool/src/connection/mod.rs +++ b/core/pool/src/connection/mod.rs @@ -7,7 +7,6 @@ use bytes::Bytes; use futures::{SinkExt, StreamExt}; use lightning_interfaces::types::NodeIndex; use lightning_interfaces::{RequestHeader, ServiceScope}; -use lightning_metrics::histogram; use tokio::io::{AsyncReadExt, AsyncWriteExt}; use tokio::sync::mpsc::{Receiver, Sender}; use tokio::sync::oneshot; @@ -55,7 +54,6 @@ pub async fn connection_loop(mut ctx: Context) -> Res let (stream_tx, stream_rx) = match accept_result { Ok(streams) => streams, Err(e) => { - report_metrics(ctx.connection.stats()); return Err(e.into()); } }; @@ -79,7 +77,6 @@ pub async fn connection_loop(mut ctx: Context) -> Res let stream_rx = match accept_result { Ok(stream) => stream, Err(e) => { - report_metrics(ctx.connection.stats()); return Err(e.into()); } }; @@ -149,40 +146,8 @@ pub async fn connection_loop(mut ctx: Context) -> Res } } - report_metrics(ctx.connection.stats()); - Ok(()) } - -#[inline] -fn report_metrics(metrics: Stats) { - histogram!( - "lost_packets", - Some("Lost packets"), - metrics.lost_packets as f64 - ); - histogram!( - "sent_packets", - Some("Sent packets"), - metrics.sent_packets as f64 - ); - histogram!( - "congestion_events", - Some("Congestion packets"), - metrics.congestion_events as f64 - ); - histogram!( - "congestion_window", - Some("Congestion window"), - metrics.cwnd as f64 - ); - histogram!( - "black_holes_detected", - Some("Black holes"), - metrics.black_holes_detected as f64 - ); -} - async fn handle_incoming_uni_stream( peer: NodeIndex, stream_rx: C::RecvStream,