File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -431,8 +431,15 @@ async fn ws_client_actor_inner(
431431
432432 // if this is the closed-by-them case, let the ClientConnectionSenders know now.
433433 sendrx. close ( ) ;
434- closed = true ;
435434 log:: trace!( "Close frame {:?}" , close_frame) ;
435+ if !closed {
436+ // This is the client telling us they want to close.
437+ WORKER_METRICS
438+ . ws_clients_closed_connection
439+ . with_label_values ( & addr)
440+ . inc ( ) ;
441+ }
442+ closed = true ;
436443 }
437444 }
438445 }
Original file line number Diff line number Diff line change @@ -21,10 +21,15 @@ metrics_group!(
2121 pub ws_clients_spawned: IntGaugeVec ,
2222
2323 #[ name = spacetime_worker_ws_clients_aborted]
24- #[ help = "Number of ws client connections aborted" ]
24+ #[ help = "Number of ws client connections aborted by either the server or the client " ]
2525 #[ labels( database_identity: Identity ) ]
2626 pub ws_clients_aborted: IntGaugeVec ,
2727
28+ #[ name = spacetime_worker_ws_clients_closed_connection]
29+ #[ help = "Number of ws client connections closed by the client as opposed to being termiated by the server" ]
30+ #[ labels( database_identity: Identity ) ]
31+ pub ws_clients_closed_connection: IntGaugeVec ,
32+
2833 #[ name = spacetime_websocket_requests_total]
2934 #[ help = "The cumulative number of websocket request messages" ]
3035 #[ labels( database_identity: Identity , protocol: str ) ]
You can’t perform that action at this time.
0 commit comments