Skip to content

Commit

Permalink
pool: remove old metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
kckeiks committed Dec 7, 2023
1 parent 3385330 commit 55bdd51
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions core/pool/src/connection/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -55,7 +54,6 @@ pub async fn connection_loop<C: ConnectionInterface>(mut ctx: Context<C>) -> Res
let (stream_tx, stream_rx) = match accept_result {
Ok(streams) => streams,
Err(e) => {
report_metrics(ctx.connection.stats());
return Err(e.into());
}
};
Expand All @@ -79,7 +77,6 @@ pub async fn connection_loop<C: ConnectionInterface>(mut ctx: Context<C>) -> Res
let stream_rx = match accept_result {
Ok(stream) => stream,
Err(e) => {
report_metrics(ctx.connection.stats());
return Err(e.into());
}
};
Expand Down Expand Up @@ -149,40 +146,8 @@ pub async fn connection_loop<C: ConnectionInterface>(mut ctx: Context<C>) -> 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<C: ConnectionInterface>(
peer: NodeIndex,
stream_rx: C::RecvStream,
Expand Down

0 comments on commit 55bdd51

Please sign in to comment.