Skip to content

Commit 3df5499

Browse files
authored
Merge 2d28389 into 3e3798f
2 parents 3e3798f + 2d28389 commit 3df5499

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

iroh-relay/src/server/client.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,10 @@ struct Actor {
210210

211211
impl Actor {
212212
async fn run(mut self, done: CancellationToken) {
213+
// Note the accept and disconnects metrics must be in a pair. Technically the
214+
// connection is accepted long before this in the HTTP server, but it is clearer to
215+
// handle the metric here.
216+
inc!(Metrics, accepts);
213217
match self.run_inner(done).await {
214218
Err(e) => {
215219
warn!("actor errored {e:#?}, exiting");
@@ -220,6 +224,7 @@ impl Actor {
220224
}
221225

222226
self.clients.unregister(self.connection_id, self.node_id);
227+
inc!(Metrics, disconnects);
223228
}
224229

225230
async fn run_inner(&mut self, done: CancellationToken) -> Result<()> {

iroh-relay/src/server/http_server.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,6 @@ impl Inner {
551551
rate_limit: self.rate_limit,
552552
};
553553
trace!("accept: create client");
554-
inc!(Metrics, accepts);
555554
let node_id = client_conn_builder.node_id;
556555
trace!(node_id = node_id.fmt_short(), "create client");
557556

0 commit comments

Comments
 (0)