Use new DHT stats fields
This commit is contained in:
parent
dfb15da131
commit
485d8cdf61
|
@ -105,7 +105,7 @@ func writeDhtServerStatus(w io.Writer, s *dht.Server) {
|
|||
fmt.Fprintf(w, "\tDHT nodes: %d (%d good, %d banned)\n", dhtStats.Nodes, dhtStats.GoodNodes, dhtStats.BadNodes)
|
||||
fmt.Fprintf(w, "\tDHT Server ID: %x\n", s.ID())
|
||||
fmt.Fprintf(w, "\tDHT port: %d\n", missinggo.AddrPort(s.Addr()))
|
||||
fmt.Fprintf(w, "\tDHT announces: %d\n", dhtStats.ConfirmedAnnounces)
|
||||
fmt.Fprintf(w, "\tDHT announces: %d\n", dhtStats.SuccessfulOutboundAnnouncePeerQueries)
|
||||
fmt.Fprintf(w, "\tOutstanding transactions: %d\n", dhtStats.OutstandingTransactions)
|
||||
}
|
||||
|
||||
|
|
|
@ -766,10 +766,9 @@ func TestAddMetainfoWithNodes(t *testing.T) {
|
|||
cl, err := NewClient(cfg)
|
||||
require.NoError(t, err)
|
||||
defer cl.Close()
|
||||
sum := func() (ret int) {
|
||||
sum := func() (ret int64) {
|
||||
cl.eachDhtServer(func(s *dht.Server) {
|
||||
ret += s.NumNodes()
|
||||
ret += s.Stats().OutstandingTransactions
|
||||
ret += s.Stats().OutboundQueriesAttempted
|
||||
})
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue