fix: trace delayed websocket acknowledgements

This commit is contained in:
richjohnrambo
2026-10-01 15:19:57 +08:00
parent 19584d0939
commit 73a594146f
19 changed files with 788 additions and 149 deletions
+7
View File
@@ -447,12 +447,19 @@ func (s *Session) queueOut(msg *ServerComMessage) bool {
logs.Err.Println("s.queueOut: session's send queue full", s.sid)
return false
}
if isAcceptedCtrl(msg) && s.proto == WEBSOCK {
immetrics.ObserveCtrlACKDelivery("enqueue", msg.Timestamp)
}
if s.isMultiplex() {
s.scheduleClusterWriteLoop()
}
return true
}
func isAcceptedCtrl(msg *ServerComMessage) bool {
return msg != nil && msg.Ctrl != nil && msg.Ctrl.Code == http.StatusAccepted && msg.Ctrl.Id != ""
}
// queueOutBytes attempts to send a ServerComMessage already serialized to []byte.
// If the send buffer is full, it fails.
func (s *Session) queueOutBytes(data []byte) bool {