mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Add total to account conn updates
Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
@@ -40,7 +40,7 @@ var (
|
||||
|
||||
const (
|
||||
// VERSION is the current version for the server.
|
||||
VERSION = "2.0.0-beta.7"
|
||||
VERSION = "2.0.0-beta.8"
|
||||
|
||||
// PROTO is the currently supported protocol.
|
||||
// 0 was the original
|
||||
|
||||
@@ -88,9 +88,10 @@ type DisconnectEventMsg struct {
|
||||
// a given account when the number of connections changes. It will also HB
|
||||
// updates in the absence of any changes.
|
||||
type AccountNumConns struct {
|
||||
Server ServerInfo `json:"server"`
|
||||
Account string `json:"acc"`
|
||||
Conns int `json:"conns"`
|
||||
Server ServerInfo `json:"server"`
|
||||
Account string `json:"acc"`
|
||||
Conns int `json:"conns"`
|
||||
TotalConns int `json:"total_conns"`
|
||||
}
|
||||
|
||||
// accNumConnsReq is sent when we are starting to track an account for the first
|
||||
@@ -677,8 +678,9 @@ func (s *Server) sendAccConnsUpdate(a *Account, subj string) {
|
||||
|
||||
// Build event with account name and number of local clients.
|
||||
m := AccountNumConns{
|
||||
Account: a.Name,
|
||||
Conns: a.numLocalConnections(),
|
||||
Account: a.Name,
|
||||
Conns: a.numLocalConnections(),
|
||||
TotalConns: len(s.clients),
|
||||
}
|
||||
a.mu.Unlock()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user