Expose RPC reconnections and ping time (#20157)

- Keeps track of reconnection count.
- Keeps track of connection ping roundtrip times. 
  Sends timestamp in ping message.
- Allow ping without payload.
This commit is contained in:
Klaus Post
2024-07-25 14:07:21 -07:00
committed by GitHub
parent 4a1edfd9aa
commit 15b609ecea
6 changed files with 307 additions and 20 deletions
+11 -2
View File
@@ -290,10 +290,19 @@ func (muxConnectError) Op() Op {
}
type pongMsg struct {
NotFound bool `msg:"nf"`
Err *string `msg:"e,allownil"`
NotFound bool `msg:"nf"`
Err *string `msg:"e,allownil"`
T time.Time `msg:"t"`
}
func (pongMsg) Op() Op {
return OpPong
}
type pingMsg struct {
T time.Time `msg:"t"`
}
func (pingMsg) Op() Op {
return OpPing
}