Skip to content

Commit

Permalink
always skip if account has never connected
Browse files Browse the repository at this point in the history
Signed-off-by: Caleb Lloyd <[email protected]>
  • Loading branch information
Caleb Lloyd committed Mar 7, 2024
1 parent b18c43b commit d7b2969
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions surveyor/collector_statz.go
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,11 @@ func (sc *StatzCollector) getAccStatz(nc *nats.Conn) (map[string][]*accStat, err
accStats := make(map[string][]*accStat)
for _, statz := range res {
for _, acc := range statz.Data.Accounts {
// always skip if account has never connected
if acc.TotalConns == 0 {
continue
}

// optimization to stop reporting a server/account pair
// when a server is continuously reporting 0 conns for that account
zeroConnKey := statz.Server.ID + ":" + acc.Account
Expand Down

0 comments on commit d7b2969

Please sign in to comment.