packages/hyprspace: show latency in status
This commit is contained in:
parent
7520d134b1
commit
f1072294a1
1 changed files with 5 additions and 1 deletions
|
@ -26,7 +26,11 @@ func (hsr *HyprspaceRPC) Status(args *Args, reply *StatusReply) error {
|
||||||
if hsr.host.Network().Connectedness(p.ID) == network.Connected {
|
if hsr.host.Network().Connectedness(p.ID) == network.Connected {
|
||||||
netPeersCurrent = netPeersCurrent + 1
|
netPeersCurrent = netPeersCurrent + 1
|
||||||
for _, c := range hsr.host.Network().ConnsToPeer(p.ID) {
|
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(),
|
||||||
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue