mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 14:15:06 +03:00
Restore uptime
, bytes_sent
and bytes_recvd
to getPeers
(#888)
* Restore `uptime`, `bytes_sent` and `bytes_recvd` to the admin API for peers * Wrap conn in Yggdrasil instead, so not necessary to do so in Ironwood * Shuffle struct for alignment
This commit is contained in:
parent
9f5cc0eecb
commit
2d2ad4692b
3 changed files with 51 additions and 7 deletions
|
@ -19,6 +19,9 @@ type PeerEntry struct {
|
|||
Port uint64 `json:"port"`
|
||||
Coords []uint64 `json:"coords"`
|
||||
Remote string `json:"remote"`
|
||||
RXBytes uint64 `json:"bytes_recvd"`
|
||||
TXBytes uint64 `json:"bytes_sent"`
|
||||
Uptime float64 `json:"uptime"`
|
||||
}
|
||||
|
||||
func (a *AdminSocket) getPeersHandler(req *GetPeersRequest, res *GetPeersResponse) error {
|
||||
|
@ -31,6 +34,9 @@ func (a *AdminSocket) getPeersHandler(req *GetPeersRequest, res *GetPeersRespons
|
|||
Port: p.Port,
|
||||
Coords: p.Coords,
|
||||
Remote: p.Remote,
|
||||
RXBytes: p.RXBytes,
|
||||
TXBytes: p.TXBytes,
|
||||
Uptime: p.Uptime.Seconds(),
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue