File tree 2 files changed +5
-1
lines changed
2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -210,6 +210,10 @@ struct Actor {
210
210
211
211
impl Actor {
212
212
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) ;
213
217
match self . run_inner ( done) . await {
214
218
Err ( e) => {
215
219
warn ! ( "actor errored {e:#?}, exiting" ) ;
@@ -220,6 +224,7 @@ impl Actor {
220
224
}
221
225
222
226
self . clients . unregister ( self . connection_id , self . node_id ) ;
227
+ inc ! ( Metrics , disconnects) ;
223
228
}
224
229
225
230
async fn run_inner ( & mut self , done : CancellationToken ) -> Result < ( ) > {
Original file line number Diff line number Diff line change @@ -551,7 +551,6 @@ impl Inner {
551
551
rate_limit : self . rate_limit ,
552
552
} ;
553
553
trace ! ( "accept: create client" ) ;
554
- inc ! ( Metrics , accepts) ;
555
554
let node_id = client_conn_builder. node_id ;
556
555
trace ! ( node_id = node_id. fmt_short( ) , "create client" ) ;
557
556
You can’t perform that action at this time.
0 commit comments