Skip to content

Commit

Permalink
remove models_vnext
Browse files Browse the repository at this point in the history
Signed-off-by: Caleb Lloyd <[email protected]>
  • Loading branch information
Caleb Lloyd committed Oct 5, 2023
1 parent f480d62 commit 9f27ed8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 32 deletions.
10 changes: 5 additions & 5 deletions surveyor/collector_statz.go
Original file line number Diff line number Diff line change
Expand Up @@ -637,15 +637,15 @@ func (sc *StatzCollector) getJSInfos(nc *nats.Conn) map[string]*server.AccountDe
return jsAccInfos
}

func (sc *StatzCollector) getAccStatz(nc *nats.Conn) (map[string]*VNextAccountStat, error) {
func (sc *StatzCollector) getAccStatz(nc *nats.Conn) (map[string]*server.AccountStat, error) {
req := &server.AccountStatzOptions{
IncludeUnused: true,
}
reqJSON, err := json.Marshal(req)
if err != nil {
return nil, err
}
res := make([]*VNextAccountStatz, 0)
res := make([]*server.AccountStatz, 0)
const subj = "$SYS.REQ.ACCOUNT.PING.STATZ"

msgs, err := requestMany(nc, sc, subj, reqJSON)
Expand All @@ -655,7 +655,7 @@ func (sc *StatzCollector) getAccStatz(nc *nats.Conn) (map[string]*VNextAccountSt

for _, msg := range msgs {
var r server.ServerAPIResponse
var d VNextAccountStatz
var d server.AccountStatz
r.Data = &d
if err := json.Unmarshal(msg.Data, &r); err != nil {
return nil, err
Expand All @@ -678,7 +678,7 @@ func (sc *StatzCollector) getAccStatz(nc *nats.Conn) (map[string]*VNextAccountSt
}
}

accStatz := make(map[string]*VNextAccountStat)
accStatz := make(map[string]*server.AccountStat)
for _, statz := range res {
for _, acc := range statz.Accounts {
accInfo, ok := accStatz[acc.Account]
Expand Down Expand Up @@ -720,7 +720,7 @@ Outer:
}
}

func mergeAccountStats(from, to *VNextAccountStat) {
func mergeAccountStats(from, to *server.AccountStat) {
to.Conns += from.Conns
to.LeafNodes += from.LeafNodes
to.TotalConns += from.TotalConns
Expand Down
27 changes: 0 additions & 27 deletions surveyor/models_vnext.go

This file was deleted.

0 comments on commit 9f27ed8

Please sign in to comment.