packages/hyprspace: show latency in status

This commit is contained in:
Max Headroom 2023-01-23 01:51:05 +01:00
parent 7520d134b1
commit f1072294a1

View file

@ -26,7 +26,11 @@ func (hsr *HyprspaceRPC) Status(args *Args, reply *StatusReply) error {
if hsr.host.Network().Connectedness(p.ID) == network.Connected {
netPeersCurrent = netPeersCurrent + 1
for _, c := range hsr.host.Network().ConnsToPeer(p.ID) {
netPeerAddrsCurrent = append(netPeerAddrsCurrent, fmt.Sprintf("%s/p2p/%s", c.RemoteMultiaddr().String(), p.ID.String()))
netPeerAddrsCurrent = append(netPeerAddrsCurrent, fmt.Sprintf("%s/p2p/%s (%s)",
c.RemoteMultiaddr().String(),
p.ID.String(),
hsr.host.Peerstore().LatencyEWMA(p.ID).String(),
))
}
}
}